From: moodler Date: Sat, 28 Dec 2002 14:45:54 +0000 (+0000) Subject: Fixes to allow the GD detection to work on PHP 4.3.0 (with bundled GD) X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=92a4b0f180a39acf420ed77821eb296a8f4d80c8;p=moodle.git Fixes to allow the GD detection to work on PHP 4.3.0 (with bundled GD) --- diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 188ac34bdb..ad0bc02def 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -1100,12 +1100,16 @@ function check_gd_version() { $gdversion = 0; + foreach ($phpinfo as $text) { - $parts = explode('',$text); + $parts = explode('',$text); foreach ($parts as $key => $val) { - $parts[$key] = strip_tags($val); + $parts[$key] = trim(strip_tags($val)); } - if ($parts[0]=="GD Version") { + if ($parts[0] == "GD Version") { + if (substr_count($parts[1], "2.0")) { + $parts[1] = "2.0"; + } $gdversion = intval($parts[1]); } }