[Plugin: com_resize] Fix for Single Quotes and Height Not Specified
-
Two com_resize Fixes
I think com_resize is a great plugin. But, version 0.1.2 is new and could use
some minor patching. For example, it does not work for img tags that use
single quotes instead of double quotes. A quick fix for that is to modify
resize.php (around line 28) and change this:preg_match_all(‘#<img.*src=”(.*)”.*/>#isU’, $text, $image_matches);
to this:
preg_match_all(‘#<img.*src=[“\’](.*)[“\’].*/>#isU’, $text, $image_matches);
This is not a perfect fix as it will not work if (for some reason) there is a quote
character embedded in the img tag’s src attribute.Another improvement is to modify the code so that it works when the width
is specified but the height is not (it already works fine, though, when the
height is specified but the width is not). To fix this just initialize the variable
$dimensions before the two conditionals that set the width and height:// added this fix for when width is specified but height is not
$dimensions = “”;I hope these fixes (or improved versions of them) make it into the next version.
Robert DeBenedictis, PRX.org
The topic ‘[Plugin: com_resize] Fix for Single Quotes and Height Not Specified’ is closed to new replies.