Skip to content

Commit d3e7663

Browse files
committed
Merge pull request #3 from adrianbj/master
Fix for incorrect GD version detection
2 parents f874707 + d1d0470 commit d3e7663

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

Image/Canvas/GD.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1861,13 +1861,9 @@ function _version()
18611861
}
18621862
}
18631863

1864-
if (preg_match('/1\.[0-9]{1,2}/', $version)) {
1865-
return 1;
1866-
} elseif (preg_match('/2\.[0-9]{1,2}/', $version)) {
1867-
return 2;
1868-
} else {
1869-
return 0;
1870-
}
1864+
preg_match('/(\d+)\./', $version, $result );
1865+
return $result[1];
1866+
18711867
}
18721868

18731869
}

0 commit comments

Comments
 (0)