SpecialMergeHistory: add redirect=no on target parameter on success message
[lhc/web/wiklou.git] / includes / parser / Parser.php
index 677da63..3b49ccf 100644 (file)
@@ -511,7 +511,10 @@ class Parser {
                        }
                        $limitReport .= 'Cached time: ' . $this->mOutput->getCacheTime() . "\n";
                        $limitReport .= 'Cache expiry: ' . $this->mOutput->getCacheExpiry() . "\n";
-                       $limitReport .= 'Dynamic content: ' . ( $this->mOutput->hasDynamicContent() ? 'true' : 'false' ) . "\n";
+                       $limitReport .= 'Dynamic content: ' .
+                               ( $this->mOutput->hasDynamicContent() ? 'true' : 'false' ) .
+                               "\n";
+
                        foreach ( $this->mOutput->getLimitReportData() as $key => $value ) {
                                if ( Hooks::run( 'ParserLimitReportFormat',
                                        array( $key, &$value, &$limitReport, false, false )
@@ -1468,14 +1471,19 @@ class Parser {
         * @private
         */
        public function makeFreeExternalLink( $url, $numPostProto ) {
-
                $trail = '';
 
                # 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] );
                }
@@ -4842,16 +4850,7 @@ class Parser {
                $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)";
 
@@ -5326,7 +5325,6 @@ class Parser {
                $ig->setParser( $this );
                $ig->setHideBadImages();
                $ig->setAttributes( Sanitizer::validateTagAttributes( $params, 'table' ) );
-               $this->getOutput()->addModuleStyles( 'mediawiki.page.gallery.styles' );
 
                if ( isset( $params['showfilename'] ) ) {
                        $ig->setShowFilename( true );