Permalink
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 4e93e23 commit c50e070d2998469b2bc28a6b6c5097c06558d58d @pauln pauln committed Sep 8, 2013
Showing with 2 additions and 3 deletions.
  1. +2 −3 lib/formslib.php
View
@@ -303,9 +303,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 c50e070

Please sign in to comment.