Remove all instances of the word "iff"
[lhc/web/wiklou.git] / includes / parser / CoreParserFunctions.php
index 41cbd08..4b6eeca 100644 (file)
@@ -139,7 +139,7 @@ class CoreParserFunctions {
                $pref = $parser->getOptions()->getDateFormat();
 
                // Specify a different default date format other than the the normal default
-               // iff the user has 'default' for their setting
+               // if the user has 'default' for their setting
                if ( $pref == 'default' && $defaultPref ) {
                        $pref = $defaultPref;
                }
@@ -377,7 +377,7 @@ class CoreParserFunctions {
 
                // disallow some styles that could be used to bypass $wgRestrictDisplayTitle
                if ( $wgRestrictDisplayTitle ) {
-                       $htmlTagsCallback = function ( $params ) {
+                       $htmlTagsCallback = function ( &$params ) {
                                $decoded = Sanitizer::decodeTagAttributes( $params );
 
                                if ( isset( $decoded['style'] ) ) {
@@ -456,7 +456,8 @@ class CoreParserFunctions {
                return self::formatRaw( SiteStats::edits(), $raw );
        }
        static function numberofviews( $parser, $raw = null ) {
-               return self::formatRaw( SiteStats::views(), $raw );
+               global $wgDisableCounters;
+               return !$wgDisableCounters ? self::formatRaw( SiteStats::views(), $raw ) : '';
        }
        static function pagesinnamespace( $parser, $namespace = 0, $raw = null ) {
                return self::formatRaw( SiteStats::pagesInNs( intval( $namespace ) ), $raw );
@@ -633,6 +634,7 @@ class CoreParserFunctions {
         * @return string
         */
        static function pagesincategory( $parser, $name = '', $arg1 = null, $arg2 = null ) {
+               global $wgContLang;
                static $magicWords = null;
                if ( is_null( $magicWords ) ) {
                        $magicWords = new MagicWordArray( array(
@@ -662,6 +664,7 @@ class CoreParserFunctions {
                if ( !$title ) { # invalid title
                        return self::formatRaw( 0, $raw );
                }
+               $wgContLang->findVariantLink( $name, $title, true );
 
                // Normalize name for cache
                $name = $title->getDBkey();
@@ -716,13 +719,7 @@ class CoreParserFunctions {
                $page = $title->getPrefixedText();
 
                $length = 0;
-               if ( $title->equals( $parser->getTitle() )
-                       && $parser->mInputSize !== false
-               ) {
-                       # We are on current page (and not in PST), so
-                       # take length of input to parser.
-                       $length = $parser->mInputSize;
-               } elseif ( isset( $cache[$page] ) ) {
+               if ( isset( $cache[$page] ) ) {
                        $length = $cache[$page];
                } elseif ( $parser->incrementExpensiveFunctionCount() ) {
                        $rev = Revision::newFromTitle( $title, false, Revision::READ_NORMAL );
@@ -861,10 +858,12 @@ class CoreParserFunctions {
                if ( $old === false || $old == $text || $arg ) {
                        return '';
                } else {
+                       $converter = $parser->getConverterLanguage()->getConverter();
                        return '<span class="error">' .
                                wfMessage( 'duplicate-defaultsort',
-                                       wfEscapeWikiText( $old ), // Message should be parsed, but these params should only be escaped.
-                                       wfEscapeWikiText( $text )
+                                       // Message should be parsed, but these params should only be escaped.
+                                       $converter->markNoConversion( wfEscapeWikiText( $old ) ),
+                                       $converter->markNoConversion( wfEscapeWikiText( $text ) )
                                )->inContentLanguage()->text() .
                                '</span>';
                }