Merge "Add MWTimestamp::getTimezoneString(), use it in file revert message"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 23 Sep 2015 20:53:50 +0000 (20:53 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 23 Sep 2015 20:53:50 +0000 (20:53 +0000)
1  2 
RELEASE-NOTES-1.26
includes/parser/Parser.php

diff --combined RELEASE-NOTES-1.26
@@@ -70,6 -70,9 +70,9 @@@ production
  * Caches that need purging ability now use the WANObjectCache interface.
    This corresponds to a new $wgMainWANCache setting, which defaults to using
    the $wgMainCacheType settings.
+ * Added MWTimestamp::getTimezoneString() which returns the localized timezone
+   string, if available. To localize this string, see the comments of
+   $wgLocaltimezone in includes/DefaultSettings.php.
  * Callers needing fast light-weight data stores use $wgMainStash to select
    the store type from $wgObjectCaches. The default is the local database.
  * Interface message overrides in the MediaWiki namespace will now be cached in
@@@ -198,13 -201,13 +201,15 @@@ changes to languages because of Phabric
  * Watchlist tokens, SpecialResetTokens, and User::getTokenFromOption()
    are deprecated. Applications using those can work via the OAuth
    extension instead. New tokens types should not be added.
+ * (T36948) The default file revert message's timestamp is now in $wgLocaltimezone,
+   instead of UTC.
  * DatabaseBase::errorCount() was removed (unused).
  * $wgDeferredUpdateList was removed.
  * DeferredUpdates::addHTMLCacheUpdate() was removed.
  * The default name of the 'suppress' group page has been changed from
    'Project:Oversight' to 'Project:Suppress'.
 +* (T84937) Free external links ("autolinked" urls) will now be terminated
 +  by &nbsp; and HTML entity encodings of &nbsp, <, and >.
  
  == Compatibility ==
  
@@@ -1474,9 -1474,8 +1474,9 @@@ class Parser 
                # The characters '<' and '>' (which were escaped by
                # removeHTMLtags()) should not be included in
                # URLs, per RFC 2396.
 +              # Make &nbsp; terminate a URL as well (bug T84937)
                $m2 = array();
 -              if ( preg_match( '/&(lt|gt);/', $url, $m2, PREG_OFFSET_CAPTURE ) ) {
 +              if ( preg_match( '/&(lt|gt|nbsp|#x0*(3[CcEe]|[Aa]0)|#0*(60|62|160));/', $url, $m2, PREG_OFFSET_CAPTURE ) ) {
                        $trail = substr( $url, $m2[0][1] ) . $trail;
                        $url = substr( $url, 0, $m2[0][1] );
                }
                $ts = $this->mOptions->getTimestamp();
                $timestamp = MWTimestamp::getLocalInstance( $ts );
                $ts = $timestamp->format( 'YmdHis' );
-               $tzMsg = $timestamp->format( 'T' );  # might vary on DST changeover!
-               # Allow translation of timezones through wiki. format() can return
-               # whatever crap the system uses, localised or not, so we cannot
-               # ship premade translations.
-               $key = 'timezone-' . strtolower( trim( $tzMsg ) );
-               $msg = wfMessage( $key )->inContentLanguage();
-               if ( $msg->exists() ) {
-                       $tzMsg = $msg->text();
-               }
+               $tzMsg = $timestamp->getTimezoneMessage()->inContentLanguage()->text();
  
                $d = $wgContLang->timeanddate( $ts, false, false ) . " ($tzMsg)";