summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-04-11 18:33:44 +0000
committerDries Buytaert <dries@buytaert.net>2010-04-11 18:33:44 +0000
commitff301288f2ea06d76606c05bccac5957e2873a94 (patch)
treeb46d9d7e56612945850281a136161967ba8bc5f2 /includes
parentde33f74b4040cc3f7880269152b277d90b081cc8 (diff)
downloadbrdo-ff301288f2ea06d76606c05bccac5957e2873a94.tar.gz
brdo-ff301288f2ea06d76606c05bccac5957e2873a94.tar.bz2
- Patch #348448 by mfb, c960657, marvil07, cdale, jpmckinney: fixed PHP strict warnings when running tests and for PHP 5.3.
Diffstat (limited to 'includes')
-rw-r--r--includes/bootstrap.inc16
-rw-r--r--includes/common.inc8
-rw-r--r--includes/database/select.inc4
-rw-r--r--includes/errors.inc2
-rw-r--r--includes/filetransfer/filetransfer.inc11
-rw-r--r--includes/install.core.inc6
-rw-r--r--includes/session.inc2
7 files changed, 36 insertions, 13 deletions
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index b64febca3..c5e3bd915 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -1817,6 +1817,21 @@ function drupal_bootstrap($phase = NULL, $new_phase = TRUE) {
}
/**
+ * Return the time zone of the current user.
+ */
+function drupal_get_user_timezone() {
+ global $user;
+ if (variable_get('configurable_timezones', 1) && $user->uid && $user->timezone) {
+ return $user->timezone;
+ }
+ else {
+ // Ignore PHP strict notice if time zone has not yet been set in the php.ini
+ // configuration.
+ return variable_get('date_default_timezone', @date_default_timezone_get());
+ }
+}
+
+/**
* Custom PHP error handler.
*
* @param $error_level
@@ -1910,6 +1925,7 @@ function _drupal_bootstrap_page_cache() {
$cache = drupal_page_get_cache();
// If there is a cached page, display it.
if (is_object($cache)) {
+ date_default_timezone_set(drupal_get_user_timezone());
// If the skipping of the bootstrap hooks is not enforced, call
// hook_boot.
if (variable_get('page_cache_invoke_hooks', TRUE)) {
diff --git a/includes/common.inc b/includes/common.inc
index 91632bf92..b3497d0d9 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -1765,13 +1765,7 @@ function format_date($timestamp, $type = 'medium', $format = '', $timezone = NUL
$timezones = &$drupal_static_fast['timezones'];
if (!isset($timezone)) {
- global $user;
- if (variable_get('configurable_timezones', 1) && $user->uid && $user->timezone) {
- $timezone = $user->timezone;
- }
- else {
- $timezone = variable_get('date_default_timezone', 'UTC');
- }
+ $timezone = date_default_timezone_get();
}
// Store DateTimeZone objects in an array rather than repeatedly
// constructing identical objects over the life of a request.
diff --git a/includes/database/select.inc b/includes/database/select.inc
index b071c7454..16c352ea3 100644
--- a/includes/database/select.inc
+++ b/includes/database/select.inc
@@ -501,11 +501,11 @@ class SelectQueryExtender implements SelectQueryInterface {
}
public function hasAllTags() {
- return call_user_func_array(array($this->query, 'hasAllTags', func_get_args()));
+ return call_user_func_array(array($this->query, 'hasAllTags'), func_get_args());
}
public function hasAnyTag() {
- return call_user_func_array(array($this->query, 'hasAnyTags', func_get_args()));
+ return call_user_func_array(array($this->query, 'hasAnyTags'), func_get_args());
}
public function addMetaData($key, $object) {
diff --git a/includes/errors.inc b/includes/errors.inc
index a171debb0..7b5a44241 100644
--- a/includes/errors.inc
+++ b/includes/errors.inc
@@ -201,7 +201,7 @@ function _drupal_log_error($error, $fatal = FALSE) {
// Display the message if the current error reporting level allows this type
// of message to be displayed, and unconditionnaly in update.php.
$error_level = variable_get('error_level', ERROR_REPORTING_DISPLAY_ALL);
- $display_error = $error_level == ERROR_REPORTING_DISPLAY_ALL || ($error_level == ERROR_REPORTING_DISPLAY_SOME && $error['%type'] != 'Notice');
+ $display_error = $error_level == ERROR_REPORTING_DISPLAY_ALL || ($error_level == ERROR_REPORTING_DISPLAY_SOME && $error['%type'] != 'Notice' && $error['%type'] != 'Strict warning');
if ($display_error || (defined('MAINTENANCE_MODE') && MAINTENANCE_MODE == 'update')) {
$class = 'error';
diff --git a/includes/filetransfer/filetransfer.inc b/includes/filetransfer/filetransfer.inc
index 27d6815a0..1afaa9e0f 100644
--- a/includes/filetransfer/filetransfer.inc
+++ b/includes/filetransfer/filetransfer.inc
@@ -24,7 +24,16 @@ abstract class FileTransfer {
$this->jail = $jail;
}
- abstract static function factory($jail, $settings);
+ /**
+ * Classes that extend this class must override the factory() static method.
+ *
+ * @param string $jail
+ * @param array $settings
+ * @return object New instance of the appropriate FileTransfer subclass.
+ */
+ static function factory($jail, $settings) {
+ throw new FileTransferException('FileTransfer::factory() static method not overridden by FileTransfer subclass.');
+ }
/**
* Implementation of the magic __get() method.
diff --git a/includes/install.core.inc b/includes/install.core.inc
index 2ddcac495..6126e7a1a 100644
--- a/includes/install.core.inc
+++ b/includes/install.core.inc
@@ -1204,7 +1204,8 @@ function install_select_locale(&$install_state) {
}
else {
include_once DRUPAL_ROOT . '/includes/form.inc';
- $output = drupal_render(drupal_get_form('install_select_locale_form', $locales, $profilename));
+ $elements = drupal_get_form('install_select_locale_form', $locales, $profilename);
+ $output = drupal_render($elements);
}
return $output;
}
@@ -1237,7 +1238,8 @@ function install_select_locale(&$install_state) {
if ($install_state['interactive']) {
drupal_set_title(st('Choose language'));
include_once DRUPAL_ROOT . '/includes/form.inc';
- return drupal_render(drupal_get_form('install_select_locale_form', $locales, $profilename));
+ $elements = drupal_get_form('install_select_locale_form', $locales, $profilename);
+ return drupal_render($elements);
}
else {
throw new Exception(st('Sorry, you must select a language to continue the installation.'));
diff --git a/includes/session.inc b/includes/session.inc
index 49bde9f8c..641d244b5 100644
--- a/includes/session.inc
+++ b/includes/session.inc
@@ -209,6 +209,7 @@ function drupal_session_initialize() {
$user = drupal_anonymous_user();
session_id(md5(uniqid('', TRUE)));
}
+ date_default_timezone_set(drupal_get_user_timezone());
}
/**
@@ -310,6 +311,7 @@ function drupal_session_regenerate() {
->condition('sid', $old_session_id)
->execute();
}
+ date_default_timezone_set(drupal_get_user_timezone());
}
/**