mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
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:
parent
f46517fe19
commit
53bc0a28dc
@ -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"));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user