]> git.mjollnir.org Git - moodle.git/commitdiff
Fixes to allow the GD detection to work on PHP 4.3.0 (with bundled GD)
authormoodler <moodler>
Sat, 28 Dec 2002 14:45:54 +0000 (14:45 +0000)
committermoodler <moodler>
Sat, 28 Dec 2002 14:45:54 +0000 (14:45 +0000)
lib/moodlelib.php

index 188ac34bdb053857c474652265953d14d585893e..ad0bc02defb9d63981e09120f1a89fe96b43d44c 100644 (file)
@@ -1100,12 +1100,16 @@ function check_gd_version() {
 
     $gdversion = 0;
 
+
     foreach ($phpinfo as $text) {
-        $parts = explode('</b>',$text);
+        $parts = explode('</td>',$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]);
         }
     }