Fix for random issue

This commit is contained in:
Matthew Barbour 2019-10-15 08:22:23 -05:00 committed by Shish
parent 3efa76c6a2
commit ed8caa86bf

View file

@ -115,7 +115,7 @@ class Image
if ($max < 1) { if ($max < 1) {
return null; return null;
} // From Issue #22 - opened by HungryFeline on May 30, 2011. } // From Issue #22 - opened by HungryFeline on May 30, 2011.
if ($max > $limit_range) { if ($limit_range > 0 && $max > $limit_range) {
$max = $limit_range; $max = $limit_range;
} }
$rand = mt_rand(0, $max-1); $rand = mt_rand(0, $max-1);