Permalink
Browse files

Fix bug #951 (Disable Meta Generator) by adding unsetMetaData and uns…

…etting tags in setMetaData when value is left blank

git-svn-id: http://svn.php.net/repository/pear/packages/HTML_Page/trunk@154530 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
1 parent 449ab77 commit 37a0836f7609d6e518a55fe2e65eb3be2f55b141 Klaus Guenther committed Mar 25, 2004
Showing with 24 additions and 3 deletions.
  1. +24 −3 Page.php
View
@@ -970,14 +970,35 @@ function setLang($lang = "en")
*/
function setMetaData($name, $content, $http_equiv = false)
{
- if ($http_equiv == true) {
- $this->_metaTags['http-equiv'][$name] = $content;
+ if ($content == '') {
+ $this->unsetMetaData($name, $http_equiv);
} else {
- $this->_metaTags['standard'][$name] = $content;
+ if ($http_equiv == true) {
+ $this->_metaTags['http-equiv'][$name] = $content;
+ } else {
+ $this->_metaTags['standard'][$name] = $content;
+ }
}
} // end func setMetaData
/**
+ * Unsets a meta tag.
+ *
+ * @param string $name Value of name or http-equiv tag
+ * @param bool $http_equiv META type "http-equiv" defaults to NULL
+ * @return void
+ * @access public
+ */
+ function unsetMetaData($name, $http_equiv = false)
+ {
+ if ($http_equiv == true) {
+ unset($this->_metaTags['http-equiv'][$name]);
+ } else {
+ unset($this->_metaTags['standard'][$name]);
+ }
+ } // end func unsetMetaData
+
+ /**
* Sets an http-equiv Content-Type meta tag
*
* @access public

0 comments on commit 37a0836

Please sign in to comment.