mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX Fix PHP notice where variable with array didn't exist in HTTP->findByTagAndAttribute()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@66043 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
3f154aaca1
commit
5df7e70cf8
@ -104,6 +104,7 @@ class HTTP {
|
||||
}
|
||||
|
||||
static function findByTagAndAttribute($content, $attribs) {
|
||||
$regExps = array();
|
||||
|
||||
foreach($attribs as $tag => $attrib) {
|
||||
if(!is_numeric($tag)) $tagPrefix = "$tag ";
|
||||
@ -114,9 +115,11 @@ class HTTP {
|
||||
$regExps[] = "/(<{$tagPrefix}[^>]*$attrib *= *)([^\"' ]*)( )/ie";
|
||||
}
|
||||
|
||||
if($regExps) {
|
||||
foreach($regExps as $regExp) {
|
||||
$content = preg_replace($regExp, '$items[] = "$2"', $content);
|
||||
}
|
||||
}
|
||||
|
||||
return isset($items) ? $items : null;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user