X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fparser%2FParser.php;h=f2e47dc36acbaa2eb8901f99b765b3d4cad23b11;hb=09b6dddae2a21c8b03efae46539cca47086f5574;hp=e901f6f311c4dedf24b81354a4ecd52814f50fbf;hpb=fb291fe9d31cba69ae8cebeb5ba04f76f35d7816;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index e901f6f311..f2e47dc36a 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -2296,8 +2296,10 @@ class Parser { $this->mOutput->addLanguageLink( $nt->getFullText() ); } - $s = rtrim( $s . $prefix ); - $s .= trim( $trail, "\n" ) == '' ? '' : $prefix . $trail; + /** + * Strip the whitespace interwiki links produce, see T10897 + */ + $s = rtrim( $s . $prefix ) . $trail; # T175416 continue; } @@ -2322,7 +2324,10 @@ class Parser { continue; } } elseif ( $ns == NS_CATEGORY ) { - $s = rtrim( $s . "\n" ); # T2087 + /** + * Strip the whitespace Category links produce, see T2087 + */ + $s = rtrim( $s . $prefix ) . $trail; # T2087, T87753 if ( $wasblank ) { $sortkey = $this->getDefaultSort(); @@ -2334,11 +2339,6 @@ class Parser { $sortkey = $this->getConverterLanguage()->convertCategoryKey( $sortkey ); $this->mOutput->addCategory( $nt->getDBkey(), $sortkey ); - /** - * Strip the whitespace Category links produce, see T2087 - */ - $s .= trim( $prefix . $trail, "\n" ) == '' ? '' : $prefix . $trail; - continue; } } @@ -2504,10 +2504,10 @@ class Parser { $value = '|'; break; case 'currentmonth': - $value = $pageLang->formatNum( MWTimestamp::getInstance( $ts )->format( 'm' ) ); + $value = $pageLang->formatNum( MWTimestamp::getInstance( $ts )->format( 'm' ), true ); break; case 'currentmonth1': - $value = $pageLang->formatNum( MWTimestamp::getInstance( $ts )->format( 'n' ) ); + $value = $pageLang->formatNum( MWTimestamp::getInstance( $ts )->format( 'n' ), true ); break; case 'currentmonthname': $value = $pageLang->getMonthName( MWTimestamp::getInstance( $ts )->format( 'n' ) ); @@ -2519,16 +2519,16 @@ class Parser { $value = $pageLang->getMonthAbbreviation( MWTimestamp::getInstance( $ts )->format( 'n' ) ); break; case 'currentday': - $value = $pageLang->formatNum( MWTimestamp::getInstance( $ts )->format( 'j' ) ); + $value = $pageLang->formatNum( MWTimestamp::getInstance( $ts )->format( 'j' ), true ); break; case 'currentday2': - $value = $pageLang->formatNum( MWTimestamp::getInstance( $ts )->format( 'd' ) ); + $value = $pageLang->formatNum( MWTimestamp::getInstance( $ts )->format( 'd' ), true ); break; case 'localmonth': - $value = $pageLang->formatNum( MWTimestamp::getLocalInstance( $ts )->format( 'm' ) ); + $value = $pageLang->formatNum( MWTimestamp::getLocalInstance( $ts )->format( 'm' ), true ); break; case 'localmonth1': - $value = $pageLang->formatNum( MWTimestamp::getLocalInstance( $ts )->format( 'n' ) ); + $value = $pageLang->formatNum( MWTimestamp::getLocalInstance( $ts )->format( 'n' ), true ); break; case 'localmonthname': $value = $pageLang->getMonthName( MWTimestamp::getLocalInstance( $ts )->format( 'n' ) ); @@ -2540,10 +2540,10 @@ class Parser { $value = $pageLang->getMonthAbbreviation( MWTimestamp::getLocalInstance( $ts )->format( 'n' ) ); break; case 'localday': - $value = $pageLang->formatNum( MWTimestamp::getLocalInstance( $ts )->format( 'j' ) ); + $value = $pageLang->formatNum( MWTimestamp::getLocalInstance( $ts )->format( 'j' ), true ); break; case 'localday2': - $value = $pageLang->formatNum( MWTimestamp::getLocalInstance( $ts )->format( 'd' ) ); + $value = $pageLang->formatNum( MWTimestamp::getLocalInstance( $ts )->format( 'd' ), true ); break; case 'pagename': $value = wfEscapeWikiText( $this->mTitle->getText() );