Merge "Recentchanges: Hide instead of disable namespace selector checkboxes"
[lhc/web/wiklou.git] / includes / parser / Parser.php
index 81e23ad..deeb858 100644 (file)
@@ -1029,7 +1029,7 @@ class Parser {
                $matches = [];
 
                $taglist = implode( '|', $elements );
-               $start = "/<($taglist)(\\s+[^>]*?|\\s*?)(\/?" . ">)|<(!--)/i";
+               $start = "/<($taglist)(\\s+[^>]*?|\\s*?)(\/?>)|<(!--)/i";
 
                while ( $text != '' ) {
                        $p = preg_split( $start, $text, 2, PREG_SPLIT_DELIM_CAPTURE );
@@ -3146,7 +3146,7 @@ class Parser {
                # $args is a list of argument nodes, starting from index 0, not including $part1
                # @todo FIXME: If piece['parts'] is null then the call to getLength()
                # below won't work b/c this $args isn't an object
-               $args = ( null == $piece['parts'] ) ? [] : $piece['parts'];
+               $args = ( $piece['parts'] == null ) ? [] : $piece['parts'];
 
                $profileSection = null; // profile templates
 
@@ -3681,7 +3681,6 @@ class Parser {
                $deps = [];
 
                # Loop to fetch the article, with up to 1 redirect
-               // phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall
                for ( $i = 0; $i < 2 && is_object( $title ); $i++ ) {
                        # Give extensions a chance to select the revision instead
                        $id = false; # Assume current
@@ -4371,7 +4370,7 @@ class Parser {
                        $anchor = $safeHeadline;
                        $fallbackAnchor = $fallbackHeadline;
                        if ( isset( $refers[$arrayKey] ) ) {
-                               // phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall,Generic.Formatting.DisallowMultipleStatements
+                               // phpcs:ignore Generic.Formatting.DisallowMultipleStatements
                                for ( $i = 2; isset( $refers["${arrayKey}_$i"] ); ++$i );
                                $anchor .= "_$i";
                                $linkAnchor .= "_$i";
@@ -4380,7 +4379,7 @@ class Parser {
                                $refers[$arrayKey] = true;
                        }
                        if ( $fallbackHeadline !== false && isset( $refers[$fallbackArrayKey] ) ) {
-                               // phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall,Generic.Formatting.DisallowMultipleStatements
+                               // phpcs:ignore Generic.Formatting.DisallowMultipleStatements
                                for ( $i = 2; isset( $refers["${fallbackArrayKey}_$i"] ); ++$i );
                                $fallbackAnchor .= "_$i";
                                $refers["${fallbackArrayKey}_$i"] = true;
@@ -5470,6 +5469,7 @@ class Parser {
         * Adds an entry to appropriate link tables.
         *
         * @since 1.32
+        * @param string $value
         * @return array of `[ type, target ]`, where:
         *   - `type` is one of:
         *     - `null`: Given value is not a valid link target, use default