mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Bugfix: Added private static $defaultFormat in order to choose default via config. Permit WCAG validation of XHTML.
This commit is contained in:
parent
fd1aa197d5
commit
6d7b938b7a
@ -45,6 +45,12 @@ class ContentNegotiator extends Object {
|
||||
* @var boolean
|
||||
*/
|
||||
private static $enabled = false;
|
||||
|
||||
/**
|
||||
* @config
|
||||
* @var string
|
||||
*/
|
||||
private static $default_format = 'html';
|
||||
|
||||
/**
|
||||
* Set the character set encoding for this page. By default it's utf-8, but you could change it to, say,
|
||||
@ -114,7 +120,7 @@ class ContentNegotiator extends Object {
|
||||
);
|
||||
$q = array();
|
||||
if(headers_sent()) {
|
||||
$chosenFormat = "html";
|
||||
$chosenFormat = Config::inst()->get('ContentNegotiator', 'default_format');
|
||||
|
||||
} else if(isset($_GET['forceFormat'])) {
|
||||
$chosenFormat = $_GET['forceFormat'];
|
||||
@ -139,7 +145,7 @@ class ContentNegotiator extends Object {
|
||||
krsort($q);
|
||||
$chosenFormat = reset($q);
|
||||
} else {
|
||||
$chosenFormat = "html";
|
||||
$chosenFormat = Config::inst()->get('ContentNegotiator', 'default_format');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user