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,7 +104,8 @@ class HTTP {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static function findByTagAndAttribute($content, $attribs) {
|
static function findByTagAndAttribute($content, $attribs) {
|
||||||
|
$regExps = array();
|
||||||
|
|
||||||
foreach($attribs as $tag => $attrib) {
|
foreach($attribs as $tag => $attrib) {
|
||||||
if(!is_numeric($tag)) $tagPrefix = "$tag ";
|
if(!is_numeric($tag)) $tagPrefix = "$tag ";
|
||||||
else $tagPrefix = "";
|
else $tagPrefix = "";
|
||||||
@ -114,8 +115,10 @@ class HTTP {
|
|||||||
$regExps[] = "/(<{$tagPrefix}[^>]*$attrib *= *)([^\"' ]*)( )/ie";
|
$regExps[] = "/(<{$tagPrefix}[^>]*$attrib *= *)([^\"' ]*)( )/ie";
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($regExps as $regExp) {
|
if($regExps) {
|
||||||
$content = preg_replace($regExp, '$items[] = "$2"', $content);
|
foreach($regExps as $regExp) {
|
||||||
|
$content = preg_replace($regExp, '$items[] = "$2"', $content);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return isset($items) ? $items : null;
|
return isset($items) ? $items : null;
|
||||||
|
Loading…
Reference in New Issue
Block a user