From e134ca8f2cf8919ec96ceae5068f8a0f7d9529cb Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Tue, 16 Sep 2008 14:29:00 +0000 Subject: [PATCH] MINOR documentation git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@62461 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/control/ContentNegotiator.php | 51 +++++++++++++++++++++++++++--- 1 file changed, 47 insertions(+), 4 deletions(-) diff --git a/core/control/ContentNegotiator.php b/core/control/ContentNegotiator.php index 74243142f..1e940c959 100755 --- a/core/control/ContentNegotiator.php +++ b/core/control/ContentNegotiator.php @@ -1,11 +1,33 @@ handleRequest() + */ static function process(HTTPResponse $response) { if(self::$disabled) return; @@ -69,6 +94,16 @@ class ContentNegotiator { $negotiator->$chosenFormat( $response ); } + /** + * Only sends the HTTP Content-Type as "application/xhtml+xml" + * if the template starts with the typical ", ,  ). + * + * @param $response HTTPResponse + * @return string + * @todo More flexible tag and entity parsing through regular expressions or tag definition lists + */ function xhtml(HTTPResponse $response) { $content = $response->getBody(); @@ -87,6 +122,14 @@ class ContentNegotiator { return $this->html($response); } } + + /* + * Sends HTTP Content-Type as "text/html", and replaces existing doctypes with + * HTML4.01 Strict. + * Replaces self-closing tags like with unclosed solitary tags like . + * Replaces all occurrences of "application/xhtml+xml" with "text/html" in the template. + * Removes "xmlns" attributes and any Pragmas. + */ function html(HTTPResponse $response) { $response->addHeader("Content-type", "text/html; charset=" . self::$encoding); $response->addHeader("Vary", "Accept");