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:21:33 +12:00
parent 85b82a9c2f
commit 59de735095

View File

@ -303,9 +303,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);