BUGFIX Fixed ErrorPage::get_filepath_for_errorcode() to work with locale values instead of short language subtags

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@75791 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2009-04-30 23:51:55 +00:00
parent d0761a3e78
commit 7e41cc2b8e

View File

@ -150,12 +150,12 @@ class ErrorPage extends Page {
* which is generated through {@link publish()}.
*
* @param int $statusCode A HTTP Statuscode, mostly 404 or 500
* @param String $lang A language code in short locale format, e.g. 'de' (Optional)
* @param String $locale A locale, e.g. 'de_DE' (Optional)
* @return String
*/
static function get_filepath_for_errorcode($statusCode, $lang = null) {
if(singleton('SiteTree')->hasExtension('Translatable') && $lang && $lang != Translatable::default_locale()) {
return self::$static_filepath . "/error-{$statusCode}-{$lang}.html";
static function get_filepath_for_errorcode($statusCode, $locale = null) {
if(singleton('SiteTree')->hasExtension('Translatable') && $locale && $locale != Translatable::default_locale()) {
return self::$static_filepath . "/error-{$statusCode}-{$locale}.html";
} else {
return self::$static_filepath . "/error-{$statusCode}.html";
}