Revision: 3255
Author: jaim...@gmail.com
Date: Thu Jul 11 02:19:15 2013
Log: Fix for issue #555. Avoid usage of anonymous functions for
backwards compatibility with PHP versions prior to 5.3.
http://code.google.com/p/simplesamlphp/source/detail?r=3255
Modified:
/trunk/modules/core/lib/Auth/Process/GenerateGroups.php
=======================================
--- /trunk/modules/core/lib/Auth/Process/GenerateGroups.php Wed Jan 16
23:59:34 2013
+++ /trunk/modules/core/lib/Auth/Process/GenerateGroups.php Thu Jul 11
02:19:15 2013
@@ -136,9 +136,23 @@
assert('is_string($string)');
return preg_replace_callback('/([^a-zA-Z0-9_@=.])/',
- function ($m) { return sprintf("%%%02x", ord($m[1])); },
+ 'self::escapeIllegalChar',
$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]));
+ }
}
--
You received this message because you are subscribed to the Google Groups
"simpleSAMLphp commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to simplesamlphp-commits+unsubscr...@googlegroups.com.
To post to this group, send email to simplesamlphp-commits@googlegroups.com.
Visit this group at http://groups.google.com/group/simplesamlphp-commits.
For more options, visit https://groups.google.com/groups/opt_out.