From 2e9e40bca784bda35606deadea8a4ddeaef02e94 Mon Sep 17 00:00:00 2001 From: Christian Schneider Date: Mon, 25 Jan 2016 13:50:26 +0100 Subject: Make check for syntax patch work with PHP 7 (throws exception on parse error in eval) --- it_auto_prepend.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'it_auto_prepend.php') diff --git a/it_auto_prepend.php b/it_auto_prepend.php index 10bee36..cea5a0d 100644 --- a/it_auto_prepend.php +++ b/it_auto_prepend.php @@ -70,7 +70,7 @@ function it_initialize() # IT_HOME is recommended variable name for applications $GLOBALS['IT_HOME'] = $GLOBALS['ULTRAHOME'] = it_untaint($GLOBALS['ULTRAHOME'], TC_ALL); - $needsconvert = $GLOBALS['IT_SYNTAXCONVERTER_DIR'] !== false && !@eval("return is_array(42=>69,);"); # Check if PHP is patched to support our syntax, see http://cschneid.com/php/ + try { $needsconvert = $GLOBALS['IT_SYNTAXCONVERTER_DIR'] !== false && !@eval("return is_array(42=>69,);"); } catch (Error $needsconvert) {} # Check if PHP is patched to support our syntax, see http://cschneid.com/php/ if ($needsconvert && !$GLOBALS['IT_SYNTAXCONVERTER_DIR']) { -- cgit v1.2.3