From 5081e0a635ad3bae93f63ab32dddd9f95cd37b47 Mon Sep 17 00:00:00 2001 From: tjhunt Date: Tue, 3 Apr 2007 08:34:39 +0000 Subject: [PATCH] Better way to detect whether a function exists in this version of PHP before redefining it. --- lib/weblib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/weblib.php b/lib/weblib.php index 45d7d2ecb1..36b2c71d0b 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -4981,7 +4981,7 @@ function notice_yesno ($message, $linkyes, $linkno, $optionsyes=NULL, $optionsno * Provide an definition of error_get_last for PHP before 5.2.0. This simply * returns NULL, since there is not way to get the right answer. */ -if (!version_compare(phpversion(), '5.2.0') >= 0) { +if (!function_exists('error_get_last')) { // the eval is needed to prevent PHP 5.2+ from getting a parse error! eval(' function error_get_last() { -- 2.39.5