Index: trunk/phase3/includes/parser/Parser.php |
— | — | @@ -213,7 +213,7 @@ |
214 | 214 | * Must not consist of all title characters, or else it will change |
215 | 215 | * the behaviour of <nowiki> in a link. |
216 | 216 | */ |
217 | | - #$this->mUniqPrefix = "\x07UNIQ" . Parser::getRandomString(); |
| 217 | + # $this->mUniqPrefix = "\x07UNIQ" . Parser::getRandomString(); |
218 | 218 | # Changed to \x7f to allow XML double-parsing -- TS |
219 | 219 | $this->mUniqPrefix = "\x7fUNIQ" . self::getRandomString(); |
220 | 220 | |
— | — | @@ -338,7 +338,7 @@ |
339 | 339 | '/(.) (?=\\?|:|;|!|%|\\302\\273)/' => '\\1 \\2', |
340 | 340 | # french spaces, Guillemet-right |
341 | 341 | '/(\\302\\253) /' => '\\1 ', |
342 | | - '/ (!\s*important)/' => ' \\1', #Beware of CSS magic word !important, bug #11874. |
| 342 | + '/ (!\s*important)/' => ' \\1', # Beware of CSS magic word !important, bug #11874. |
343 | 343 | ); |
344 | 344 | $text = preg_replace( array_keys($fixtags), array_values($fixtags), $text ); |
345 | 345 | |
— | — | @@ -556,7 +556,7 @@ |
557 | 557 | $taglist = implode( '|', $elements ); |
558 | 558 | $start = "/<($taglist)(\\s+[^>]*?|\\s*?)(\/?" . ">)|<(!--)/i"; |
559 | 559 | |
560 | | - while ( $text != '' ) { |
| 560 | + while ( $text !== '' ) { |
561 | 561 | $p = preg_split( $start, $text, 2, PREG_SPLIT_DELIM_CAPTURE ); |
562 | 562 | $stripped .= $p[0]; |
563 | 563 | if( count( $p ) < 5 ) { |
— | — | @@ -723,11 +723,11 @@ |
724 | 724 | array_push( $tr_history , false ); |
725 | 725 | array_push( $tr_attributes , '' ); |
726 | 726 | array_push( $has_opened_tr , false ); |
727 | | - } else if ( count ( $td_history ) == 0 ) { |
| 727 | + } elseif ( count ( $td_history ) == 0 ) { |
728 | 728 | // Don't do any of the following |
729 | 729 | $out .= $outLine."\n"; |
730 | 730 | continue; |
731 | | - } else if ( substr ( $line , 0 , 2 ) === '|}' ) { |
| 731 | + } elseif ( substr ( $line , 0 , 2 ) === '|}' ) { |
732 | 732 | // We are ending a table |
733 | 733 | $line = '</table>' . substr ( $line , 2 ); |
734 | 734 | $last_tag = array_pop ( $last_tag_history ); |
— | — | @@ -745,7 +745,7 @@ |
746 | 746 | } |
747 | 747 | array_pop ( $tr_attributes ); |
748 | 748 | $outLine = $line . str_repeat( '</dd></dl>' , $indent_level ); |
749 | | - } else if ( substr ( $line , 0 , 2 ) === '|-' ) { |
| 749 | + } elseif ( substr ( $line , 0 , 2 ) === '|-' ) { |
750 | 750 | // Now we have a table row |
751 | 751 | $line = preg_replace( '#^\|-+#', '', $line ); |
752 | 752 | |
— | — | @@ -773,7 +773,7 @@ |
774 | 774 | array_push ( $td_history , false ); |
775 | 775 | array_push ( $last_tag_history , '' ); |
776 | 776 | } |
777 | | - else if ( $first_character === '|' || $first_character === '!' || substr ( $line , 0 , 2 ) === '|+' ) { |
| 777 | + elseif ( $first_character === '|' || $first_character === '!' || substr ( $line , 0 , 2 ) === '|+' ) { |
778 | 778 | // This might be cell elements, td, th or captions |
779 | 779 | if ( substr ( $line , 0 , 2 ) === '|+' ) { |
780 | 780 | $first_character = '+'; |
— | — | @@ -818,9 +818,9 @@ |
819 | 819 | |
820 | 820 | if ( $first_character === '|' ) { |
821 | 821 | $last_tag = 'td'; |
822 | | - } else if ( $first_character === '!' ) { |
| 822 | + } elseif ( $first_character === '!' ) { |
823 | 823 | $last_tag = 'th'; |
824 | | - } else if ( $first_character === '+' ) { |
| 824 | + } elseif ( $first_character === '+' ) { |
825 | 825 | $last_tag = 'caption'; |
826 | 826 | } else { |
827 | 827 | $last_tag = ''; |
— | — | @@ -835,7 +835,7 @@ |
836 | 836 | // be mistaken as delimiting cell parameters |
837 | 837 | if ( strpos( $cell_data[0], '[[' ) !== false ) { |
838 | 838 | $cell = "{$previous}<{$last_tag}>{$cell}"; |
839 | | - } else if ( count ( $cell_data ) == 1 ) |
| 839 | + } elseif ( count ( $cell_data ) == 1 ) |
840 | 840 | $cell = "{$previous}<{$last_tag}>{$cell_data[0]}"; |
841 | 841 | else { |
842 | 842 | $attributes = $this->mStripState->unstripBoth( $cell_data[0] ); |
— | — | @@ -1136,7 +1136,7 @@ |
1137 | 1137 | } |
1138 | 1138 | # If there are more than 6 apostrophes in a row, assume they're all |
1139 | 1139 | # text except for the last 6. |
1140 | | - else if ( strlen( $arr[$i] ) > 6 ) |
| 1140 | + elseif ( strlen( $arr[$i] ) > 6 ) |
1141 | 1141 | { |
1142 | 1142 | $arr[$i-1] .= str_repeat( "'", strlen( $arr[$i] ) - 6 ); |
1143 | 1143 | $arr[$i] = "''''''"; |
— | — | @@ -1144,9 +1144,9 @@ |
1145 | 1145 | # Count the number of occurrences of bold and italics mark-ups. |
1146 | 1146 | # We are not counting sequences of five apostrophes. |
1147 | 1147 | if ( strlen( $arr[$i] ) == 2 ) { $numitalics++; } |
1148 | | - else if ( strlen( $arr[$i] ) == 3 ) { $numbold++; } |
1149 | | - else if ( strlen( $arr[$i] ) == 5 ) { $numitalics++; $numbold++; } |
1150 | | - else if ( strlen( $arr[$i] ) == 6 ) { $numbold+=2; } |
| 1148 | + elseif ( strlen( $arr[$i] ) == 3 ) { $numbold++; } |
| 1149 | + elseif ( strlen( $arr[$i] ) == 5 ) { $numitalics++; $numbold++; } |
| 1150 | + elseif ( strlen( $arr[$i] ) == 6 ) { $numbold+=2; } |
1151 | 1151 | } |
1152 | 1152 | $i++; |
1153 | 1153 | } |
— | — | @@ -1159,25 +1159,25 @@ |
1160 | 1160 | { |
1161 | 1161 | $i = 0; |
1162 | 1162 | |
1163 | | - #These are indexes to the /next/ array entry than the |
1164 | | - #one holding the text matching the condition. |
| 1163 | + # These are indexes to the /next/ array entry than the |
| 1164 | + # one holding the text matching the condition. |
1165 | 1165 | $firstsingleletterword = -1; |
1166 | 1166 | $firstmultiletterword = -1; |
1167 | 1167 | $firstspace = -1; |
1168 | 1168 | |
1169 | 1169 | foreach ( $arr as $r ) |
1170 | 1170 | { |
1171 | | - #Filter the "'''". Separators are on odd positions. |
1172 | | - #$arr[0] will be an empty string if needed. |
| 1171 | + # Filter the "'''". Separators are on odd positions. |
| 1172 | + # $arr[0] will be an empty string if needed. |
1173 | 1173 | if ( ( $i % 2 == 1 ) and ( strlen( $r ) == 3 ) ) |
1174 | 1174 | { |
1175 | 1175 | $x1 = substr ($arr[$i-1], -1); |
1176 | 1176 | $x2 = substr ($arr[$i-1], -2, 1); |
1177 | 1177 | if ($x1 === ' ') { |
1178 | 1178 | if ($firstspace == -1) $firstspace = $i; |
1179 | | - } else if ($x2 === ' ') { |
| 1179 | + } elseif ($x2 === ' ') { |
1180 | 1180 | if ($firstsingleletterword == -1) $firstsingleletterword = $i; |
1181 | | - } else if ($arr[$i-1] != "") { |
| 1181 | + } elseif ($arr[$i-1] !== "") { |
1182 | 1182 | if ($firstmultiletterword == -1) $firstmultiletterword = $i; |
1183 | 1183 | } |
1184 | 1184 | } |
— | — | @@ -1191,7 +1191,7 @@ |
1192 | 1192 | $arr [ $firstsingleletterword-1 ] .= "'"; |
1193 | 1193 | } |
1194 | 1194 | # If not, but there's a multi-letter word, use that one. |
1195 | | - else if ($firstmultiletterword > -1) |
| 1195 | + elseif ($firstmultiletterword > -1) |
1196 | 1196 | { |
1197 | 1197 | $arr [ $firstmultiletterword ] = "''"; |
1198 | 1198 | $arr [ $firstmultiletterword-1 ] .= "'"; |
— | — | @@ -1199,7 +1199,7 @@ |
1200 | 1200 | # ... otherwise use the first one that has neither. |
1201 | 1201 | # (notice that it is possible for all three to be -1 if, for example, |
1202 | 1202 | # there is only one pentuple-apostrophe in the line) |
1203 | | - else if ($firstspace > -1) |
| 1203 | + elseif ($firstspace > -1) |
1204 | 1204 | { |
1205 | 1205 | $arr [ $firstspace ] = "''"; |
1206 | 1206 | $arr [ $firstspace-1 ] .= "'"; |
— | — | @@ -1207,9 +1207,9 @@ |
1208 | 1208 | } |
1209 | 1209 | |
1210 | 1210 | # Now let's actually convert our apostrophic mush to HTML! |
1211 | | - $output = ''; #Processed text |
1212 | | - $buffer = ''; #Content if $state is 'both' |
1213 | | - $state = ''; #Flags with the order of open tags: '|b|i|bi|ib|both' |
| 1211 | + $output = ''; # Processed text |
| 1212 | + $buffer = ''; # Content if $state is 'both' |
| 1213 | + $state = ''; # Flags with the order of open tags: '|b|i|bi|ib|both' |
1214 | 1214 | $i = 0; |
1215 | 1215 | foreach ($arr as $r) |
1216 | 1216 | { |
— | — | @@ -1226,54 +1226,54 @@ |
1227 | 1227 | { |
1228 | 1228 | if ($state === 'i') |
1229 | 1229 | { $output .= '</i>'; $state = ''; } |
1230 | | - else if ($state === 'bi') |
| 1230 | + elseif ($state === 'bi') |
1231 | 1231 | { $output .= '</i>'; $state = 'b'; } |
1232 | | - else if ($state === 'ib') |
| 1232 | + elseif ($state === 'ib') |
1233 | 1233 | { $output .= '</b></i><b>'; $state = 'b'; } |
1234 | | - else if ($state === 'both') |
| 1234 | + elseif ($state === 'both') |
1235 | 1235 | { $output .= '<b><i>'.$buffer.'</i>'; $state = 'b'; } |
1236 | 1236 | else # $state can be 'b' or '' |
1237 | 1237 | { $output .= '<i>'; $state .= 'i'; } |
1238 | 1238 | } |
1239 | | - else if (strlen ($r) == 3) |
| 1239 | + elseif (strlen ($r) == 3) |
1240 | 1240 | { |
1241 | 1241 | if ($state === 'b') |
1242 | 1242 | { $output .= '</b>'; $state = ''; } |
1243 | | - else if ($state === 'bi') |
| 1243 | + elseif ($state === 'bi') |
1244 | 1244 | { $output .= '</i></b><i>'; $state = 'i'; } |
1245 | | - else if ($state === 'ib') |
| 1245 | + elseif ($state === 'ib') |
1246 | 1246 | { $output .= '</b>'; $state = 'i'; } |
1247 | | - else if ($state === 'both') |
| 1247 | + elseif ($state === 'both') |
1248 | 1248 | { $output .= '<i><b>'.$buffer.'</b>'; $state = 'i'; } |
1249 | 1249 | else # $state can be 'i' or '' |
1250 | 1250 | { $output .= '<b>'; $state .= 'b'; } |
1251 | 1251 | } |
1252 | | - else if (strlen ($r) == 5) |
| 1252 | + elseif (strlen ($r) == 5) |
1253 | 1253 | { |
1254 | 1254 | if ($state === 'b') |
1255 | 1255 | { $output .= '</b><i>'; $state = 'i'; } |
1256 | | - else if ($state === 'i') |
| 1256 | + elseif ($state === 'i') |
1257 | 1257 | { $output .= '</i><b>'; $state = 'b'; } |
1258 | | - else if ($state === 'bi') |
| 1258 | + elseif ($state === 'bi') |
1259 | 1259 | { $output .= '</i></b>'; $state = ''; } |
1260 | | - else if ($state === 'ib') |
| 1260 | + elseif ($state === 'ib') |
1261 | 1261 | { $output .= '</b></i>'; $state = ''; } |
1262 | | - else if ($state === 'both') |
| 1262 | + elseif ($state === 'both') |
1263 | 1263 | { $output .= '<i><b>'.$buffer.'</b></i>'; $state = ''; } |
1264 | 1264 | else # ($state == '') |
1265 | 1265 | { $buffer = ''; $state = 'both'; } |
1266 | 1266 | } |
1267 | | - else if (strlen ($r) == 6) |
| 1267 | + elseif (strlen ($r) == 6) |
1268 | 1268 | { |
1269 | 1269 | if ($state === 'b') |
1270 | 1270 | { $output .= '</b><b>'; $state = 'b'; } |
1271 | | - else if ($state === 'i') |
| 1271 | + elseif ($state === 'i') |
1272 | 1272 | { $output .= '\'</i><b>'; $state = 'b'; } |
1273 | | - else if ($state === 'bi') |
| 1273 | + elseif ($state === 'bi') |
1274 | 1274 | { $output .= '\'</i></b>'; $state = ''; } |
1275 | | - else if ($state === 'ib') |
| 1275 | + elseif ($state === 'ib') |
1276 | 1276 | { $output .= '\'</b></i>'; $state = ''; } |
1277 | | - else if ($state === 'both') |
| 1277 | + elseif ($state === 'both') |
1278 | 1278 | { $output .= '<i><b>'.$buffer.'</b><b>'; $state = 'ib'; } |
1279 | 1279 | else # ($state == '') |
1280 | 1280 | { $buffer = ''; $state = ''; } |
— | — | @@ -1536,9 +1536,9 @@ |
1537 | 1537 | $sk = $this->mOptions->getSkin(); |
1538 | 1538 | $holders = new LinkHolderArray( $this ); |
1539 | 1539 | |
1540 | | - #split the entire text string on occurences of [[ |
| 1540 | + # split the entire text string on occurences of [[ |
1541 | 1541 | $a = StringUtils::explode( '[[', ' ' . $s ); |
1542 | | - #get the first element (all text up to first [[), and remove the space we added |
| 1542 | + # get the first element (all text up to first [[), and remove the space we added |
1543 | 1543 | $s = $a->current(); |
1544 | 1544 | $a->next(); |
1545 | 1545 | $line = $a->current(); # Workaround for broken ArrayIterator::next() that returns "void" |
— | — | @@ -1683,10 +1683,10 @@ |
1684 | 1684 | |
1685 | 1685 | if ( $might_be_img ) { # if this is actually an invalid link |
1686 | 1686 | wfProfileIn( __METHOD__."-might_be_img" ); |
1687 | | - if ( $ns == NS_FILE && $noforce ) { #but might be an image |
| 1687 | + if ( $ns == NS_FILE && $noforce ) { # but might be an image |
1688 | 1688 | $found = false; |
1689 | 1689 | while ( true ) { |
1690 | | - #look at the next 'line' to see if we can close it there |
| 1690 | + # look at the next 'line' to see if we can close it there |
1691 | 1691 | $a->next(); |
1692 | 1692 | $next_line = $a->current(); |
1693 | 1693 | if ( $next_line === false || $next_line === null ) { |
— | — | @@ -1700,24 +1700,24 @@ |
1701 | 1701 | $trail = $m[2]; |
1702 | 1702 | break; |
1703 | 1703 | } elseif ( count( $m ) == 2 ) { |
1704 | | - #if there's exactly one ]] that's fine, we'll keep looking |
| 1704 | + # if there's exactly one ]] that's fine, we'll keep looking |
1705 | 1705 | $text .= "[[{$m[0]}]]{$m[1]}"; |
1706 | 1706 | } else { |
1707 | | - #if $next_line is invalid too, we need look no further |
| 1707 | + # if $next_line is invalid too, we need look no further |
1708 | 1708 | $text .= '[[' . $next_line; |
1709 | 1709 | break; |
1710 | 1710 | } |
1711 | 1711 | } |
1712 | 1712 | if ( !$found ) { |
1713 | 1713 | # we couldn't find the end of this imageLink, so output it raw |
1714 | | - #but don't ignore what might be perfectly normal links in the text we've examined |
| 1714 | + # but don't ignore what might be perfectly normal links in the text we've examined |
1715 | 1715 | $holders->merge( $this->replaceInternalLinks2( $text ) ); |
1716 | 1716 | $s .= "{$prefix}[[$link|$text"; |
1717 | 1717 | # note: no $trail, because without an end, there *is* no trail |
1718 | 1718 | wfProfileOut( __METHOD__."-might_be_img" ); |
1719 | 1719 | continue; |
1720 | 1720 | } |
1721 | | - } else { #it's not an image, so output it raw |
| 1721 | + } else { # it's not an image, so output it raw |
1722 | 1722 | $s .= "{$prefix}[[$link|$text"; |
1723 | 1723 | # note: no $trail, because without an end, there *is* no trail |
1724 | 1724 | wfProfileOut( __METHOD__."-might_be_img" ); |
— | — | @@ -1794,7 +1794,7 @@ |
1795 | 1795 | } |
1796 | 1796 | |
1797 | 1797 | # Self-link checking |
1798 | | - if( $nt->getFragment() === '' && $ns != NS_SPECIAL ) { |
| 1798 | + if( $nt->getFragment() === '' && $ns !== NS_SPECIAL ) { |
1799 | 1799 | if( in_array( $nt->getPrefixedText(), $selflink, true ) ) { |
1800 | 1800 | $s .= $prefix . $sk->makeSelfLinkObj( $nt, $text, '', $trail ); |
1801 | 1801 | continue; |
— | — | @@ -1914,7 +1914,7 @@ |
1915 | 1915 | */ |
1916 | 1916 | /* private */ function closeParagraph() { |
1917 | 1917 | $result = ''; |
1918 | | - if ( $this->mLastSection != '' ) { |
| 1918 | + if ( $this->mLastSection !== '' ) { |
1919 | 1919 | $result = '</' . $this->mLastSection . ">\n"; |
1920 | 1920 | } |
1921 | 1921 | $this->mInPre = false; |
— | — | @@ -1930,7 +1930,7 @@ |
1931 | 1931 | if ( $fl < $shorter ) { $shorter = $fl; } |
1932 | 1932 | |
1933 | 1933 | for ( $i = 0; $i < $shorter; ++$i ) { |
1934 | | - if ( $st1{$i} != $st2{$i} ) { break; } |
| 1934 | + if ( $st1{$i} !== $st2{$i} ) { break; } |
1935 | 1935 | } |
1936 | 1936 | return $i; |
1937 | 1937 | } |
— | — | @@ -2103,7 +2103,7 @@ |
2104 | 2104 | '<td|<th|<\\/?div|<hr|<\\/pre|<\\/p|'.$this->mUniqPrefix.'-pre|<\\/li|<\\/ul|<\\/ol|<\\/?center)/iS', $t ); |
2105 | 2105 | if ( $openmatch or $closematch ) { |
2106 | 2106 | $paragraphStack = false; |
2107 | | - # TODO bug 5718: paragraph closed |
| 2107 | + # TODO bug 5718: paragraph closed |
2108 | 2108 | $output .= $this->closeParagraph(); |
2109 | 2109 | if ( $preOpenMatch and !$preCloseMatch ) { |
2110 | 2110 | $this->mInPre = true; |
— | — | @@ -2113,8 +2113,8 @@ |
2114 | 2114 | } else { |
2115 | 2115 | $inBlockElem = true; |
2116 | 2116 | } |
2117 | | - } else if ( !$inBlockElem && !$this->mInPre ) { |
2118 | | - if ( ' ' == substr( $t, 0, 1 ) and ( $this->mLastSection === 'pre' or trim($t) != '' ) ) { |
| 2117 | + } elseif ( !$inBlockElem && !$this->mInPre ) { |
| 2118 | + if ( ' ' == substr( $t, 0, 1 ) and ( $this->mLastSection === 'pre' or trim($t) !== '' ) ) { |
2119 | 2119 | // pre |
2120 | 2120 | if ($this->mLastSection !== 'pre') { |
2121 | 2121 | $paragraphStack = false; |
— | — | @@ -2143,7 +2143,7 @@ |
2144 | 2144 | $output .= $paragraphStack; |
2145 | 2145 | $paragraphStack = false; |
2146 | 2146 | $this->mLastSection = 'p'; |
2147 | | - } else if ($this->mLastSection !== 'p') { |
| 2147 | + } elseif ($this->mLastSection !== 'p') { |
2148 | 2148 | $output .= $this->closeParagraph().'<p>'; |
2149 | 2149 | $this->mLastSection = 'p'; |
2150 | 2150 | } |
— | — | @@ -2164,7 +2164,7 @@ |
2165 | 2165 | $output .= $this->closeList( $prefix2[$prefixLength-1] ); |
2166 | 2166 | --$prefixLength; |
2167 | 2167 | } |
2168 | | - if ( $this->mLastSection != '' ) { |
| 2168 | + if ( $this->mLastSection !== '' ) { |
2169 | 2169 | $output .= '</' . $this->mLastSection . '>'; |
2170 | 2170 | $this->mLastSection = ''; |
2171 | 2171 | } |
— | — | @@ -2970,7 +2970,7 @@ |
2971 | 2971 | $isHTML = true; |
2972 | 2972 | $this->disableCache(); |
2973 | 2973 | } |
2974 | | - } else if ( $wgNonincludableNamespaces && in_array( $title->getNamespace(), $wgNonincludableNamespaces ) ) { |
| 2974 | + } elseif ( $wgNonincludableNamespaces && in_array( $title->getNamespace(), $wgNonincludableNamespaces ) ) { |
2975 | 2975 | $found = false; //access denied |
2976 | 2976 | wfDebug( __METHOD__.": template inclusion denied for " . $title->getPrefixedDBkey() ); |
2977 | 2977 | } else { |
— | — | @@ -3583,7 +3583,7 @@ |
3584 | 3584 | if (preg_match("/^$markerRegex/", $headline, $markerMatches)) { |
3585 | 3585 | $serial = $markerMatches[1]; |
3586 | 3586 | list( $titleText, $sectionIndex ) = $this->mHeadings[$serial]; |
3587 | | - $isTemplate = ($titleText != $baseTitleText); |
| 3587 | + $isTemplate = ($titleText !== $baseTitleText); |
3588 | 3588 | $headline = preg_replace("/^$markerRegex/", "", $headline); |
3589 | 3589 | } |
3590 | 3590 | |
— | — | @@ -3699,7 +3699,7 @@ |
3700 | 3700 | if ( $legacyHeadline == $safeHeadline ) { |
3701 | 3701 | # No reason to have both (in fact, we can't) |
3702 | 3702 | $legacyHeadline = false; |
3703 | | - } elseif ( $legacyHeadline != Sanitizer::escapeId( |
| 3703 | + } elseif ( $legacyHeadline !== Sanitizer::escapeId( |
3704 | 3704 | $legacyHeadline, 'xml' ) ) { |
3705 | 3705 | # The legacy id is invalid XML. We used to allow this, but |
3706 | 3706 | # there's no reason to do so anymore. Backward |
— | — | @@ -3873,8 +3873,8 @@ |
3874 | 3874 | else |
3875 | 3875 | continue; |
3876 | 3876 | } |
3877 | | - if ( $s['index'] != $section || |
3878 | | - $s['fromtitle'] != $titletext ) { |
| 3877 | + if ( $s['index'] !== $section || |
| 3878 | + $s['fromtitle'] !== $titletext ) { |
3879 | 3879 | self::incrementNumbering( $numbering, |
3880 | 3880 | $s['toclevel'], $lastLevel ); |
3881 | 3881 | |
— | — | @@ -3925,7 +3925,7 @@ |
3926 | 3926 | private static function incrementNumbering( &$number, $level, $lastLevel ) { |
3927 | 3927 | if ( $level > $lastLevel ) |
3928 | 3928 | $number[$level - 1] = 1; |
3929 | | - else if ( $level < $lastLevel ) { |
| 3929 | + elseif ( $level < $lastLevel ) { |
3930 | 3930 | foreach ( $number as $key => $unused ) |
3931 | 3931 | if ( $key >= $level ) |
3932 | 3932 | unset( $number[$key] ); |
— | — | @@ -4035,7 +4035,7 @@ |
4036 | 4036 | $m = array(); |
4037 | 4037 | if ( preg_match( "/^($nc+:|)$tc+?( \\($tc+\\))$/", $t, $m ) ) { |
4038 | 4038 | $text = preg_replace( $p2, "[[$m[1]\\1$m[2]|\\1]]", $text ); |
4039 | | - } elseif ( preg_match( "/^($nc+:|)$tc+?(, $tc+|)$/", $t, $m ) && "$m[1]$m[2]" != '' ) { |
| 4039 | + } elseif ( preg_match( "/^($nc+:|)$tc+?(, $tc+|)$/", $t, $m ) && "$m[1]$m[2]" !== '' ) { |
4040 | 4040 | $text = preg_replace( $p2, "[[$m[1]\\1$m[2]|\\1]]", $text ); |
4041 | 4041 | } else { |
4042 | 4042 | # if there's no context, don't bother duplicating the title |
— | — | @@ -4874,7 +4874,7 @@ |
4875 | 4875 | if ( $node->getName() === 'h' ) { |
4876 | 4876 | $bits = $node->splitHeading(); |
4877 | 4877 | $curLevel = $bits['level']; |
4878 | | - if ( $bits['i'] != $sectionIndex && $curLevel <= $targetLevel ) { |
| 4878 | + if ( $bits['i'] !== $sectionIndex && $curLevel <= $targetLevel ) { |
4879 | 4879 | break; |
4880 | 4880 | } |
4881 | 4881 | } |
— | — | @@ -4890,7 +4890,7 @@ |
4891 | 4891 | // Add two newlines on -- trailing whitespace in $newText is conventionally |
4892 | 4892 | // stripped by the editor, so we need both newlines to restore the paragraph gap |
4893 | 4893 | // Only add trailing whitespace if there is newText |
4894 | | - if($newText != "") { |
| 4894 | + if($newText !== "") { |
4895 | 4895 | $outText .= $newText . "\n\n"; |
4896 | 4896 | } |
4897 | 4897 | |