From 6e53fbc6639d4b703e4abcd075ca79873a040977 Mon Sep 17 00:00:00 2001 From: Astefanoaie Nicolae Stelian Date: Mon, 20 Jun 2016 11:49:22 +0200 Subject: [PATCH 1/2] preg_match throw an warning The line 139 throw an warning: preg_match(): Unknown modifier ']'. Remove from regular expression the "/" character --- cookbook/security/custom_authentication_provider.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbook/security/custom_authentication_provider.rst b/cookbook/security/custom_authentication_provider.rst index 0410519eae5..5dc109ddb4d 100644 --- a/cookbook/security/custom_authentication_provider.rst +++ b/cookbook/security/custom_authentication_provider.rst @@ -135,7 +135,7 @@ set an authenticated token in the token storage if successful. { $request = $event->getRequest(); - $wsseRegex = '/UsernameToken Username="([^"]+)", PasswordDigest="([^"]+)", Nonce="([a-zA-Z0-9+/]+={0,2})", Created="([^"]+)"/'; + $wsseRegex = '/UsernameToken Username="([^"]+)", PasswordDigest="([^"]+)", Nonce="([a-zA-Z0-9+]+={0,2})", Created="([^"]+)"/'; if (!$request->headers->has('x-wsse') || 1 !== preg_match($wsseRegex, $request->headers->get('x-wsse'), $matches)) { return; } From 7952b61fef41dfd580d9be9ecd96a4a91d065e97 Mon Sep 17 00:00:00 2001 From: Astefanoaie Nicolae Stelian Date: Mon, 20 Jun 2016 12:14:36 +0200 Subject: [PATCH 2/2] prefix \ from wsse regex --- cookbook/security/custom_authentication_provider.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbook/security/custom_authentication_provider.rst b/cookbook/security/custom_authentication_provider.rst index 5dc109ddb4d..f79f8156c73 100644 --- a/cookbook/security/custom_authentication_provider.rst +++ b/cookbook/security/custom_authentication_provider.rst @@ -135,7 +135,7 @@ set an authenticated token in the token storage if successful. { $request = $event->getRequest(); - $wsseRegex = '/UsernameToken Username="([^"]+)", PasswordDigest="([^"]+)", Nonce="([a-zA-Z0-9+]+={0,2})", Created="([^"]+)"/'; + $wsseRegex = '/UsernameToken Username="([^"]+)", PasswordDigest="([^"]+)", Nonce="([a-zA-Z0-9+\/]+={0,2})", Created="([^"]+)"/'; if (!$request->headers->has('x-wsse') || 1 !== preg_match($wsseRegex, $request->headers->get('x-wsse'), $matches)) { return; }