From 3f63a13558df1254bd832f7da635d52e3f163bc9 Mon Sep 17 00:00:00 2001 From: Andrey Kutejko Date: Sun, 30 Sep 2018 09:35:10 +0200 Subject: [PATCH] fix deprecations --- ipf/admin/model.php | 2 +- ipf/router.php | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/ipf/admin/model.php b/ipf/admin/model.php index 9253fe0..6a56ef4 100644 --- a/ipf/admin/model.php +++ b/ipf/admin/model.php @@ -530,7 +530,7 @@ class IPF_Admin_Model $str = $this->$listMethod($o); } else { $t = $o->getTable()->getTypeOf($h['name']); - $str = $o->$h['name']; + $str = $o->{$h['name']}; switch ($t) { case 'boolean': if ($str) diff --git a/ipf/router.php b/ipf/router.php index ffe2dac..e660706 100644 --- a/ipf/router.php +++ b/ipf/router.php @@ -159,11 +159,10 @@ class IPF_Router_RegexMatch } next($params); } - $func = create_function('$matches', - 'static $p = '.var_export($params, true).'; '. - '$a = current($p); '. - 'next($p); '. - 'return $a;'); + $params_index = 0; + $func = function($matches) use($params, &$params_index) { + return $params[$params_index++]; + }; $url = preg_replace_callback($groups, $func, $url_regex); } $url = substr(substr($url, 2), 0, -2); -- 2.49.0