From 3afa91be85d6e537e1f80b8b14a3a99cb820861f Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Wed, 18 Apr 2012 16:46:32 +1200 Subject: [PATCH] Don't try and initialize gettext unless it's installed. --- htdocs/always.php | 10 ++++++---- inc/always.php.in | 8 +++++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/htdocs/always.php b/htdocs/always.php index b553823b..27b635a9 100644 --- a/htdocs/always.php +++ b/htdocs/always.php @@ -62,7 +62,7 @@ $c->images = $c->base_url . '/images'; $c->template_usr = array( 'active' => true, 'locale' => 'en_GB', 'date_format_type' => 'E', - 'email_ok' => @date('Y-m-d') + 'email_ok' => date('Y-m-d') ); $c->hide_TODO = true; // VTODO only visible to collection owner @@ -167,8 +167,10 @@ else if ( isset($c->dbg['script_start']) && $c->dbg['script_start'] ) { * default site locale. This may be overridden by each user. */ putenv("LANG=". $c->default_locale); -awl_set_locale($c->default_locale); -init_gettext( 'davical', $c->locale_path ); +if ( function_exists('awl_set_locale') ) { + awl_set_locale($c->default_locale); + init_gettext( 'davical', $c->locale_path ); +} /** * Work out our version @@ -183,7 +185,7 @@ if ( isset($c->version_string) && preg_match( '/(\d+)\.(\d+)\.(\d+)(.*)/', $c->v $c->code_patch = $matches[3]; $c->code_version = (($c->code_major * 1000) + $c->code_minor).'.'.$c->code_patch; dbg_error_log('caldav', 'Version (%d.%d.%d) == %s', $c->code_major, $c->code_minor, $c->code_patch, $c->code_version); - header( sprintf('Server: %d.%d', $c->code_major, $c->code_minor) ); + @header( sprintf('Server: %d.%d', $c->code_major, $c->code_minor) ); } /** diff --git a/inc/always.php.in b/inc/always.php.in index 37916a68..95a743f6 100644 --- a/inc/always.php.in +++ b/inc/always.php.in @@ -167,8 +167,10 @@ else if ( isset($c->dbg['script_start']) && $c->dbg['script_start'] ) { * default site locale. This may be overridden by each user. */ putenv("LANG=". $c->default_locale); -awl_set_locale($c->default_locale); -init_gettext( 'davical', $c->locale_path ); +if ( function_exists('awl_set_locale') ) { + awl_set_locale($c->default_locale); + init_gettext( 'davical', $c->locale_path ); +} /** * Work out our version @@ -183,7 +185,7 @@ if ( isset($c->version_string) && preg_match( '/(\d+)\.(\d+)\.(\d+)(.*)/', $c->v $c->code_patch = $matches[3]; $c->code_version = (($c->code_major * 1000) + $c->code_minor).'.'.$c->code_patch; dbg_error_log('caldav', 'Version (%d.%d.%d) == %s', $c->code_major, $c->code_minor, $c->code_patch, $c->code_version); - header( sprintf('Server: %d.%d', $c->code_major, $c->code_minor) ); + @header( sprintf('Server: %d.%d', $c->code_major, $c->code_minor) ); } /** -- 2.11.4.GIT