Browse files

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.
  • Loading branch information...
1 parent 52b6176 commit 6cb665f18c9cbc99c576da894fc4002ec620ddcd @pauln pauln committed Sep 8, 2013
Showing with 2 additions and 3 deletions.
  1. +2 −3 lib/formslib.php
View
5 lib/formslib.php
@@ -302,9 +302,8 @@ protected function _get_post_params() {
$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);

0 comments on commit 6cb665f

Please sign in to comment.