From 459351939da21dcbcf22d35e4b89e731dc5925ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=B3na=20Lore?= Date: Sat, 9 Dec 2017 21:51:55 +0100 Subject: [PATCH] Improved removeMeta() method. --- e107_handlers/application.php | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/e107_handlers/application.php b/e107_handlers/application.php index 88369711a..0b2eb5c81 100644 --- a/e107_handlers/application.php +++ b/e107_handlers/application.php @@ -4080,21 +4080,32 @@ class eResponse /** - * @param $name - * @return $this + * Removes a Meta tag by name/property. + * + * @param string $name + * 'name' or 'property' for the meta tag we want to remove. + * + * @return eResponse $this */ public function removeMeta($name) { foreach($this->_meta as $k=>$v) { - if($v['name'] === $name) + // Meta tags like: + if(isset($v['name']) && $v['name'] === $name) + { + unset($this->_meta[$k]); + continue; + } + + // Meta tags like: + if(isset($v['property']) && $v['property'] === $name) { unset($this->_meta[$k]); } } return $this; - }