# HG changeset patch # User Tom Fredrik "BFG" Klaussen # Date 1350512928 -7200 # Node ID 1d4c980f4255f86e66e28191f25b93d09d194075 # Parent aafc23919e79e8ab35064b5e2cf0dcded7f31b34 Change the way headers are set. Disabled validation for non-html pages. diff -r aafc23919e79 -r 1d4c980f4255 Flag.inc --- a/Flag.inc Wed Oct 17 21:23:02 2012 +0200 +++ b/Flag.inc Thu Oct 18 00:28:48 2012 +0200 @@ -66,6 +66,12 @@ return false; } + function mayValidate() + { + return false; + } + + /** * Produce the actual content */ @@ -79,7 +85,7 @@ } else { $flag = new PageContent($flag); - $flag->addHeader("Content-Type: image/png"); + $flag->setHeader('Content-Type', 'image/png'); return $flag; } } diff -r aafc23919e79 -r 1d4c980f4255 Page.inc --- a/Page.inc Wed Oct 17 21:23:02 2012 +0200 +++ b/Page.inc Thu Oct 18 00:28:48 2012 +0200 @@ -18,9 +18,9 @@ $this->content = $content; } - function addHeader($txt) + function setHeader($headername, $value) { - array_push($this->headers, $txt); + $this->headers[$headername] = $value; } function __toString() @@ -160,8 +160,8 @@ function display() { $res = $this->genPage(); - foreach ($res->headers as $header) { - header($header); + foreach ($res->headers as $header => $value) { + header("${header}: ${value}"); } print $res; } diff -r aafc23919e79 -r 1d4c980f4255 Sitemap.inc --- a/Sitemap.inc Wed Oct 17 21:23:02 2012 +0200 +++ b/Sitemap.inc Thu Oct 18 00:28:48 2012 +0200 @@ -33,6 +33,11 @@ return false; } + function mayValidate() + { + return false; + } + function generateContent() { /// The final output variable $out = ''; @@ -104,7 +109,7 @@ $out .= ''; $res = new PageContent($out); - $res->addHeader('Content-type: application/xml'); + $res->setHeader('Content-type', 'application/xml'); return $res; } }