From: Andrey Kutejko Date: Sun, 30 Sep 2018 07:35:10 +0000 (+0200) Subject: fix deprecations X-Git-Tag: 0.5~1 X-Git-Url: https://git.andy128k.dev/?a=commitdiff_plain;h=3f63a13558df1254bd832f7da635d52e3f163bc9;p=ipf.git fix deprecations --- 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);