Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 2.0.0RC2

Request #951 [Patch] Disable Meta Generator
Submitted: 2004-03-05 16:44 UTC
From: dostick at ctco dot lv Assigned:
Status: Closed Package: HTML_Page
PHP Version: 4.3.4 OS: UNIX
Roadmaps: (Not assigned)    
Subscription  


 [2004-03-05 16:44 UTC] dostick at ctco dot lv
Description: ------------ Sometimes it is needed to disable Meta "Generator" tag. --- Page.php.2 Fri Mar 5 18:44:53 2004 +++ Page.php Fri Mar 5 18:49:25 2004 @@ -976,6 +976,18 @@ $this->_metaTags['standard'][$name] = $content; } } // end func setMetaData + + /** + * Disables "Generator" meta tag + * + * @access public + * @return void + */ + function disableGeneratorMeta() + { + unset($this->_metaTags['standard']["Generator"]) ; + $this->_metaTags=array_values($this->_metaTags); + } // end func disableGeneratorMeta /** * Sets an http-equiv Content-Type meta tag Reproduce code: --------------- $Page->setMetaData("Generator",""); Expected result: ---------------- no output of tag Actual result: -------------- <meta name="Generator" content="">

Comments

 [2004-03-25 00:21 UTC] thesaur at php dot net
Has been fixed in CVS. It will be included in the next release. Thank you for bringing this to my attention. The way I solved it was by adding an unsetMetaData($name, $http-equiv = false) method. I also have changed setMetaData to reflect your desired handling (if value is left blank, the tag is unset). You may now disable the Generator tag this way: $page->unsetMetaData("Generator"); or $page->setMetaData("Generator", "");