Home » Images » Image_Canvas » Bug #6769
ImageMap.php doesnot check for boolean false with strpos
Details
| Submitted | 2006-02-13 15:44 UTC |
|---|---|
| From | peter at jingo dot com |
| Assigned | nosey |
| Status | Closed |
| Package | Image_Canvas |
| PHP Version | 5.1.0 |
| OS | Red Hat |
| Roadmaps | (Not assigned) |
Comments
[2006-02-13 15:44 UTC] peter at jingo dot com
Description:
------------
the function _addMapTag($shape, $coords, $params) contains a check for double quotes when generating the image map.
The check (which returns true even if no double quotes are used) is:
if (strpos($value, '"') >= 0) {
$tags .= $key . '=\'' . $value . '\'';
} else {
$tags .= $key . '="' . $value . '"';
}
Test script:
---------------
the fix is:
if (strpos($value, '"') === false) {
$tags .= $key . '="' . $value . '"';
} else {
$tags .= $key . '=\'' . $value . '\'';
}
Expected result:
----------------
<area shape="circle" coords="75,72,2" href="#test" target="_blank" alt="test" title="test">