From: Ævar Arnfjörð Bjarmason Date: Sat, 2 Apr 2005 22:17:05 +0000 (+0000) Subject: * Documented X-Git-Tag: 1.5.0alpha1~421 X-Git-Url: https://git.cyclocoop.org//%22?a=commitdiff_plain;h=0f7a4033c604129def965a9e0caa0872cf69e8ab;p=lhc%2Fweb%2Fwiklou.git * Documented * Changed the validateTimeZone max from ��15:59 to 14:59 and -12:59 * Removed a stray ';' --- diff --git a/includes/SpecialPreferences.php b/includes/SpecialPreferences.php index a6cd0fc16f..07eef4ea94 100644 --- a/includes/SpecialPreferences.php +++ b/includes/SpecialPreferences.php @@ -145,7 +145,13 @@ class PreferencesForm { } /** + * Used to validate the user inputed timezone before saving it as + * 'timeciorrection', will return '00:00' if fed bogus data. + * Note: It's not a 100% correct implementation timezone-wise, it will + * accept stuff like '14:30', * @access private + * @param string $s the user input + * @return string */ function validateTimeZone( $s ) { if ( $s !== '' ) { @@ -159,8 +165,10 @@ class PreferencesForm { $hour = intval( $minute / 60 ); $minute = abs( $minute ) % 60; } - $hour = min( $hour, 15 ); - $hour = max( $hour, -15 ); + # Max is +14:00 and min is -12:00, see: + # http://en.wikipedia.org/wiki/Timezone + $hour = min( $hour, 14 ); + $hour = max( $hour, -12 ); $minute = min( $minute, 59 ); $minute = max( $minute, 0 ); $s = sprintf( "%02d:%02d", $hour, $minute ); @@ -175,7 +183,6 @@ class PreferencesForm { global $wgUser, $wgLang, $wgOut; global $wgEnableUserEmail, $wgEnableEmail; global $wgEmailAuthentication, $wgMinimalPasswordLength; -; if ( '' != $this->mNewpass ) { if ( $this->mNewpass != $this->mRetypePass ) { @@ -605,7 +612,6 @@ class PreferencesForm { # Date format # - if ($dateopts) { $wgOut->addHTML( "
\n$dateFormat\n" ); foreach($dateopts as $key => $option) {