From 6cb665f18c9cbc99c576da894fc4002ec620ddcd Mon Sep 17 00:00:00 2001 From: Paul Nicholls Date: Mon, 9 Sep 2013 11:21:33 +1200 Subject: [PATCH] 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. --- lib/formslib.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/formslib.php b/lib/formslib.php index 725aac7d219..af4d8af47cd 100644 --- a/lib/formslib.php +++ b/lib/formslib.php @@ -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);