User proper anonymous function

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2017-08-06 21:52:26 +02:00
parent 8b0051eb40
commit 459ae6d94a
No known key found for this signature in database
GPG key ID: F941078878347C0C

View file

@ -148,11 +148,12 @@ class Route extends SymfonyRoute implements IRoute {
* @return void
*/
public function actionInclude($file) {
$function = create_function('$param',
'unset($param["_route"]);'
.'$_GET=array_merge($_GET, $param);'
.'unset($param);'
.'require_once "'.$file.'";');
$function = function($param) use ($file) {
unset($param["_route"]);
$_GET=array_merge($_GET, $param);
unset($param);
require_once "'.$file.'";
} ;
$this->action($function);
}
}