From 460986b37e00f77336dcdf162cdb9b097c455040 Mon Sep 17 00:00:00 2001 From: Dominic Watson Date: Wed, 30 Oct 2024 13:51:46 +0000 Subject: [PATCH 1/2] [twgit] Init feature 'feature-PRESIDECMS-2965_fix-issues-with-numeric-rest-user-ids'. From 00c072fe14f9f76f677925a456471f9a7bb3754e Mon Sep 17 00:00:00 2001 From: Dominic Watson Date: Wed, 30 Oct 2024 13:52:11 +0000 Subject: [PATCH 2/2] PRESIDECMS-2965 use Len() rather than .len(). Has no issues dealing with variables that get converted to numbers. --- system/services/rest/PresideRestAuthService.cfc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/system/services/rest/PresideRestAuthService.cfc b/system/services/rest/PresideRestAuthService.cfc index ca8e93a75f..3f0b934c7e 100644 --- a/system/services/rest/PresideRestAuthService.cfc +++ b/system/services/rest/PresideRestAuthService.cfc @@ -30,7 +30,7 @@ component { var providerFeature = configuredProviders[ arguments.provider ].feature ?: ""; var coldbox = $getColdbox(); - if ( providerFeature.len() && !$isFeatureEnabled( providerFeature ) ) { + if ( Len( providerFeature ) && !$isFeatureEnabled( providerFeature ) ) { _failRequest( restRequest, restResponse, "Authentication provider [#provider#] is not enabled." ); return; } @@ -47,7 +47,7 @@ component { , eventArguments = { restRequest=restRequest, restResponse=restResponse } ); - if ( IsSimpleValue( userId ?: {} ) && userId.len() ) { + if ( IsSimpleValue( userId ?: {} ) && Len( userId ) ) { restRequest.setUser( userId ); return; } @@ -101,7 +101,7 @@ component { , required any restResponse , required string defaultStatusText ) { - var statusText = restResponse.getStatusText().len() ? restResponse.getStatusText() : arguments.defaultStatusText; + var statusText = Len( restResponse.getStatusText() ) ? restResponse.getStatusText() : arguments.defaultStatusText; restRequest.finish(); if ( restResponse.getStatusCode() == 200 ) {