From: <pdo...@us...> - 2008-09-24 01:57:10
|
Revision: 13283 http://squirrelmail.svn.sourceforge.net/squirrelmail/?rev=13283&view=rev Author: pdontthink Date: 2008-09-24 01:56:59 +0000 (Wed, 24 Sep 2008) Log Message: ----------- Just fiddling. Give credit where credit is due. Template class header() function now supports the 'replace' argument. Modified Paths: -------------- trunk/squirrelmail/class/template/Template.class.php trunk/squirrelmail/functions/page_header.php trunk/squirrelmail/src/style.php Modified: trunk/squirrelmail/class/template/Template.class.php =================================================================== --- trunk/squirrelmail/class/template/Template.class.php 2008-09-23 07:56:40 UTC (rev 13282) +++ trunk/squirrelmail/class/template/Template.class.php 2008-09-24 01:56:59 UTC (rev 13283) @@ -1389,16 +1389,23 @@ * * @param mixed $headers A list of (or a single) header * text to be sent. + * @param boolean $replace Whether or not to replace header(s) + * previously sent header(s) of the + * same type (this parameter may be + * ignored in some implementations + * of this class if the target interface + * does not support this functionality) + * (OPTIONAL; default = TRUE, always replace). * */ - function header($headers) + function header($headers, $replace=TRUE) { if (!is_array($headers)) $headers = array($headers); foreach ($headers as $header) { $this->assign('header', $header); - header($this->fetch('header.tpl')); + header($this->fetch('header.tpl'), $replace); } } Modified: trunk/squirrelmail/functions/page_header.php =================================================================== --- trunk/squirrelmail/functions/page_header.php 2008-09-23 07:56:40 UTC (rev 13282) +++ trunk/squirrelmail/functions/page_header.php 2008-09-24 01:56:59 UTC (rev 13283) @@ -41,6 +41,10 @@ $oTemplate->header('Pragma: no-cache'); // http 1.0 (rfc1945) $oTemplate->header('Cache-Control: private, no-cache, no-store'); // http 1.1 (rfc2616) + // don't show version as a security measure + //$oTemplate->header('X-Powered-By: SquirrelMail/' . SM_VERSION, FALSE); + $oTemplate->header('X-Powered-By: SquirrelMail', FALSE); + $oTemplate->assign('frames', $frames); $oTemplate->assign('lang', $squirrelmail_language); Modified: trunk/squirrelmail/src/style.php =================================================================== --- trunk/squirrelmail/src/style.php 2008-09-23 07:56:40 UTC (rev 13282) +++ trunk/squirrelmail/src/style.php 2008-09-24 01:56:59 UTC (rev 13283) @@ -180,16 +180,20 @@ . 'css/stylesheet.tpl') ) { $gmlastmod = gmdate('D, d M Y H:i:s', $lastmod) . ' GMT'; $expires = gmdate('D, d M Y H:i:s', strtotime('+1 week')) . ' GMT'; - header('Last-Modified: ' . $gmlastmod); - header('Expires: '. $expires); - header('Pragma: '); - header('Cache-Control: public, must-revalidate'); + $oTemplate->header('Last-Modified: ' . $gmlastmod); + $oTemplate->header('Expires: '. $expires); + $oTemplate->header('Pragma: '); + $oTemplate->header('Cache-Control: public, must-revalidate'); } // Steve, why did you remove this? Is it irrelevant now? If so, let's // remove the rest of the references to it here (note that it is being // used above in the filetime() statement) and elsewhere // $oTemplate->display('css/stylesheet.tpl'); +// don't show version as a security measure +//$oTemplate->header('X-Powered-By: SquirrelMail/' . SM_VERSION, FALSE); +$oTemplate->header('X-Powered-By: SquirrelMail', FALSE); + /** * Additional styles are now handled by adding stylesheets to * templates/<template>/css/, so here, we simply define some This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |