BUGFIX Deleted setting of $content variable that broke HTTP::findByTagAndAttribute()

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@70052 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2009-01-13 03:27:41 +00:00 committed by Sam Minnee
parent f46517fe19
commit 53bc0a28dc

View File

@ -102,12 +102,10 @@ class HTTP {
static function findByTagAndAttribute($content, $attribs) {
$regExps = array();
$content = '';
foreach($attribs as $tag => $attrib) {
if(!is_numeric($tag)) $tagPrefix = "$tag ";
else $tagPrefix = "";
$tagPrefix = (is_numeric($tag)) ? '' : "$tag ";
$regExps[] = "/(<{$tagPrefix}[^>]*$attrib *= *\")([^\"]*)(\")/ie";
$regExps[] = "/(<{$tagPrefix}[^>]*$attrib *= *')([^']*)(')/ie";
$regExps[] = "/(<{$tagPrefix}[^>]*$attrib *= *)([^\"' ]*)( )/ie";
@ -125,6 +123,7 @@ class HTTP {
static function getLinksIn($content) {
return self::findByTagAndAttribute($content, array("a" => "href"));
}
static function getImagesIn($content) {
return self::findByTagAndAttribute($content, array("img" => "src"));
}