MDL-41451 - formslib: use create_function instead of inline function

As per MDL-39432, closure-style inline functions can result in fatal
errors when using eAccelerator and thus should be avoided.
This commit is contained in:
Paul Nicholls
2013-09-09 11:41:17 +12:00
parent 52b617673c
commit 6cb665f18c
+2 -3
View File
@@ -302,9 +302,8 @@ abstract class moodleform {
$str = file_get_contents("php://input");
$delim = '&';
$chunks = array_map(function($p) use ($delim) {
return implode($delim, $p);
}, array_chunk(explode($delim, $str), $max));
$fun = create_function('$p', 'return implode("'.$delim.'", $p);');
$chunks = array_map($fun, array_chunk(explode($delim, $str), $max));
foreach ($chunks as $chunk) {
parse_str($chunk, $values);