Active
Project:
Teaser Thumbnail
Version:
6.x-1.6
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 May 2012 at 16:41 UTC
Updated:
7 May 2012 at 16:41 UTC
In the following function, in the second preg_match, I believe $text should be replaced with $string
/**
* Remove media (<img> and <object>) from a string.
*/
function _teaserthumbnail_strip_media($string) {
// We remove all the pictures from the text
$img_pattern = "/<img[^>]+src=\"[^\"]+\"[^>]*>/i";
$string = preg_replace($img_pattern, '', $string);
// We now remove the object blocks (video, flash)
$object_pattern = "/<object[0-9 a-z_?*=\":\-\/\.#\,<>\\n\\r\\t]+<\/object>/smi";
$text = preg_replace($object_pattern, '', $string);
return $string;
}
eg:
/**
* Remove media (<img> and <object>) from a string.
*/
function _teaserthumbnail_strip_media($string) {
// We remove all the pictures from the text
$img_pattern = "/<img[^>]+src=\"[^\"]+\"[^>]*>/i";
$string = preg_replace($img_pattern, '', $string);
// We now remove the object blocks (video, flash)
$object_pattern = "/<object[0-9 a-z_?*=\":\-\/\.#\,<>\\n\\r\\t]+<\/object>/smi";
$string = preg_replace($object_pattern, '', $string);
return $string;
}