You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lines 524-526
if(strpos($src, "/") == 0) {
$src = substr($src, -(strlen($src) - 1));
}
Given the input "image.jpg", strpos will return false, which matches the 0
you are matching for. This is because, instead of strpos saying "there is a
slash in position 0", it is saying "there is no slash". It will be
evaluated as "if false == 0", which will come back as true. The if
statement will then execute, and it will cut the first character off $src,
despite it not being a slash. $src is now set to "mages.jpg".
Possible fix: Do an type-check (===) to make sure strpos is actually
returning an integer (0) as a position, and not a binary value (false) as a
report that there are no slashes.
Original issue reported on code.google.com by netri...@gmail.com on 10 May 2009 at 6:42
The text was updated successfully, but these errors were encountered:
Sorry, slight inconsistency: I used "image.jpg" at the beginning of my report,
and
assumed "images.jpg" at the end. The $src would actually be set to "mage.jpg"
after
execution.
Original comment by netri...@gmail.com on 10 May 2009 at 6:49
Original issue reported on code.google.com by
netri...@gmail.com
on 10 May 2009 at 6:42The text was updated successfully, but these errors were encountered: