From: Mikael Nordfeldth Date: Fri, 9 May 2014 08:46:46 +0000 (+0200) Subject: curry.php can always be included (we use PHP>5.2) X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c664efcf1ffc712f15d46ffbb39fff5af5772b32;p=quix0rs-gnu-social.git curry.php can always be included (we use PHP>5.2) --- diff --git a/lib/util.php b/lib/util.php index 8a259df7c1..c76f7b2762 100644 --- a/lib/util.php +++ b/lib/util.php @@ -951,24 +951,7 @@ function callback_helper($matches, $callback, $arg=null) { return substr($matches[0],0,$left) . $result . substr($matches[0],$right); } -if (version_compare(PHP_VERSION, '5.3.0', 'ge')) { - // lambda implementation in a separate file; PHP 5.2 won't parse it. - require_once INSTALLDIR . "/lib/curry.php"; -} else { - function curry($fn) { - $args = func_get_args(); - array_shift($args); - $id = uniqid('_partial'); - $GLOBALS[$id] = array($fn, $args); - return create_function('', - '$args = func_get_args(); '. - 'return call_user_func_array('. - '$GLOBALS["'.$id.'"][0],'. - 'array_merge('. - '$args,'. - '$GLOBALS["'.$id.'"][1]));'); - } -} +require_once INSTALLDIR . "/lib/curry.php"; function common_linkify($url) { // It comes in special'd, so we unspecial it before passing to the stringifying