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;
}