mirror of
https://github.com/e107inc/e107.git
synced 2025-01-18 05:09:05 +01:00
Merge pull request #2906 from lonalore/meta
Improved removeMeta() method.
This commit is contained in:
commit
fabbef1bfc
@ -4080,21 +4080,32 @@ class eResponse
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $name
|
* Removes a Meta tag by name/property.
|
||||||
* @return $this
|
*
|
||||||
|
* @param string $name
|
||||||
|
* 'name' or 'property' for the meta tag we want to remove.
|
||||||
|
*
|
||||||
|
* @return eResponse $this
|
||||||
*/
|
*/
|
||||||
public function removeMeta($name)
|
public function removeMeta($name)
|
||||||
{
|
{
|
||||||
foreach($this->_meta as $k=>$v)
|
foreach($this->_meta as $k=>$v)
|
||||||
{
|
{
|
||||||
if($v['name'] === $name)
|
// Meta tags like: <meta content="..." name="description" />
|
||||||
|
if(isset($v['name']) && $v['name'] === $name)
|
||||||
|
{
|
||||||
|
unset($this->_meta[$k]);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Meta tags like: <meta content="..." property="og:title" />
|
||||||
|
if(isset($v['property']) && $v['property'] === $name)
|
||||||
{
|
{
|
||||||
unset($this->_meta[$k]);
|
unset($this->_meta[$k]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user