From 176a0d6c5a0ca5671a535e32ee54f9540bcbc276 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20P=C3=A9rez=20Crespo?= <jaime.perez@uninett.no> Date: Mon, 24 Feb 2014 19:07:41 +0000 Subject: [PATCH] Revert "Fix for issue #555. Avoid usage of anonymous functions for backwards compatibility with PHP versions prior to 5.3." This reverts commit 55a8e255100c226c388192ee608d1cfa9ba72afb. git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@3378 44740490-163a-0410-bde0-09ae8108e29a --- .../core/lib/Auth/Process/GenerateGroups.php | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/modules/core/lib/Auth/Process/GenerateGroups.php b/modules/core/lib/Auth/Process/GenerateGroups.php index 61db17e77..3b4acf0bc 100644 --- a/modules/core/lib/Auth/Process/GenerateGroups.php +++ b/modules/core/lib/Auth/Process/GenerateGroups.php @@ -136,24 +136,10 @@ class sspmod_core_Auth_Process_GenerateGroups extends SimpleSAML_Auth_Processing assert('is_string($string)'); return preg_replace_callback('/([^a-zA-Z0-9_@=.])/', - 'self::escapeIllegalChar', + function ($m) { return sprintf("%%%02x", ord($m[1])); }, $string); } - /** - * Escapes a single special character. - * - * This function is used as a callback by escapeIllegalChars. - * - * @param array $matches The matches array provided by - * preg_*() functions. $matches[0] is the complete match, while - * $matches[1] is the specific subpattern enclosed in parenthesis - * that triggers the match. - */ - private static function escapeIllegalChar($matches) { - return sprintf("%%%02x", ord($matches[1])); - } - } -?> +?> \ No newline at end of file -- GitLab