Index: trunk/phase3/maintenance/storage/checkStorage.php |
— | — | @@ -99,6 +99,9 @@ |
100 | 100 | $res = $dbr->select( 'text', array( 'old_id', 'old_flags' ), |
101 | 101 | 'old_id IN (' . implode( ',', $this->oldIdMap ) . ')', __METHOD__ ); |
102 | 102 | foreach ( $res as $row ) { |
| 103 | + /** |
| 104 | + * @var $flags int |
| 105 | + */ |
103 | 106 | $flags = $row->old_flags; |
104 | 107 | $id = $row->old_id; |
105 | 108 | |
Index: trunk/phase3/maintenance/benchmarks/benchmarkHooks.php |
— | — | @@ -49,7 +49,7 @@ |
50 | 50 | $wgHooks['Test'][] = array( $this, 'test' );
|
51 | 51 | }
|
52 | 52 | $time = $this->benchHooks();
|
53 | | - $this->output( 'Loaded (ten) hook: ' . $time . "\n" );
|
| 53 | + $this->output( 'Loaded (one hundred) hook: ' . $time . "\n" );
|
54 | 54 | $this->output( "\n" );
|
55 | 55 | }
|
56 | 56 |
|
Index: trunk/phase3/tests/phpunit/includes/upload/UploadFromUrlTest.php |
— | — | @@ -36,7 +36,10 @@ |
37 | 37 | * Ensure that the job queue is empty before continuing |
38 | 38 | */ |
39 | 39 | public function testClearQueue() { |
40 | | - while ( $job = Job::pop() ) { } |
| 40 | + $job = Job::pop(); |
| 41 | + while ( $job ) { |
| 42 | + $job = Job::pop(); |
| 43 | + } |
41 | 44 | $this->assertFalse( $job ); |
42 | 45 | } |
43 | 46 | |
Index: trunk/phase3/tests/phpunit/includes/search/SearchEngineTest.php |
— | — | @@ -64,8 +64,10 @@ |
65 | 65 | $this->assertTrue( is_object( $results ) ); |
66 | 66 | |
67 | 67 | $matches = array(); |
68 | | - while ( $row = $results->next() ) { |
| 68 | + $row = $results->next(); |
| 69 | + while ( $row ) { |
69 | 70 | $matches[] = $row->getTitle()->getPrefixedText(); |
| 71 | + $row = $results->next(); |
70 | 72 | } |
71 | 73 | $results->free(); |
72 | 74 | # Search is not guaranteed to return results in a certain order; |
Index: trunk/phase3/includes/search/SearchUpdate.php |
— | — | @@ -37,7 +37,7 @@ |
38 | 38 | global $wgContLang, $wgDisableSearchUpdate; |
39 | 39 | |
40 | 40 | if( $wgDisableSearchUpdate || !$this->mId ) { |
41 | | - return false; |
| 41 | + return; |
42 | 42 | } |
43 | 43 | |
44 | 44 | wfProfileIn( __METHOD__ ); |
Index: trunk/phase3/includes/objectcache/DBABagOStuff.php |
— | — | @@ -184,8 +184,10 @@ |
185 | 185 | |
186 | 186 | $result[] = $k1; |
187 | 187 | |
188 | | - while ( $key = dba_nextkey( $reader ) ) { |
| 188 | + $key = dba_nextkey( $reader ); |
| 189 | + while ( $key ) { |
189 | 190 | $result[] = $key; |
| 191 | + $key = dba_nextkey( $reader ) |
190 | 192 | } |
191 | 193 | |
192 | 194 | return $result; |
Index: trunk/phase3/includes/Linker.php |
— | — | @@ -1823,9 +1823,8 @@ |
1824 | 1824 | return Linker::revDeleteLink( $query, |
1825 | 1825 | $rev->isDeleted( File::DELETED_RESTRICTED ), $canHide ); |
1826 | 1826 | } |
1827 | | - } else { |
1828 | | - return ''; |
1829 | 1827 | } |
| 1828 | + return ''; |
1830 | 1829 | } |
1831 | 1830 | |
1832 | 1831 | /** |
Index: trunk/phase3/includes/EditPage.php |
— | — | @@ -2938,6 +2938,7 @@ |
2939 | 2939 | $wgOut->permissionRequired( 'upload' ); |
2940 | 2940 | return false; |
2941 | 2941 | } |
| 2942 | + return false; |
2942 | 2943 | } |
2943 | 2944 | |
2944 | 2945 | /** |
Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -1201,12 +1201,12 @@ |
1202 | 1202 | public function addHTML( $text ) { |
1203 | 1203 | $this->mBodytext .= $text; |
1204 | 1204 | } |
1205 | | - |
| 1205 | + |
1206 | 1206 | /** |
1207 | 1207 | * Shortcut for adding an Html::element via addHTML. |
1208 | | - * |
| 1208 | + * |
1209 | 1209 | * @since 1.19 |
1210 | | - * |
| 1210 | + * |
1211 | 1211 | * @param $element string |
1212 | 1212 | * @param $attribs array |
1213 | 1213 | * @param $contents string |
— | — | @@ -1730,6 +1730,7 @@ |
1731 | 1731 | } elseif ( $this->mPreventClickjacking && $wgEditPageFrameOptions ) { |
1732 | 1732 | return $wgEditPageFrameOptions; |
1733 | 1733 | } |
| 1734 | + return false; |
1734 | 1735 | } |
1735 | 1736 | |
1736 | 1737 | /** |
Index: trunk/phase3/includes/installer/Ibm_db2Installer.php |
— | — | @@ -216,12 +216,13 @@ |
217 | 217 | $result = $this->db->query( 'SELECT PAGESIZE FROM SYSCAT.TABLESPACES' ); |
218 | 218 | if( $result == false ) { |
219 | 219 | $status->fatal( 'config-connection-error', '' ); |
220 | | - } |
221 | | - else { |
222 | | - while ( $row = $this->db->fetchRow( $result ) ) { |
| 220 | + } else { |
| 221 | + $row = $this->db->fetchRow( $result ); |
| 222 | + while ( $row ) { |
223 | 223 | if( $row[0] >= 32768 ) { |
224 | 224 | return $status; |
225 | 225 | } |
| 226 | + $row = $this->db->fetchRow( $result ); |
226 | 227 | } |
227 | 228 | $status->fatal( 'config-ibm_db2-low-db-pagesize', '' ); |
228 | 229 | } |
Index: trunk/phase3/includes/Sanitizer.php |
— | — | @@ -33,7 +33,7 @@ |
34 | 34 | * Regular expression to match various types of character references in |
35 | 35 | * Sanitizer::normalizeCharReferences and Sanitizer::decodeCharReferences |
36 | 36 | */ |
37 | | - const CHAR_REFS_REGEX = |
| 37 | + const CHAR_REFS_REGEX = |
38 | 38 | '/&([A-Za-z0-9\x80-\xff]+); |
39 | 39 | |&\#([0-9]+); |
40 | 40 | |&\#[xX]([0-9A-Fa-f]+); |
— | — | @@ -335,7 +335,7 @@ |
336 | 336 | $attribFirst = '[:A-Z_a-z0-9]'; |
337 | 337 | $attrib = '[:A-Z_a-z-.0-9]'; |
338 | 338 | $space = '[\x09\x0a\x0d\x20]'; |
339 | | - self::$attribsRegex = |
| 339 | + self::$attribsRegex = |
340 | 340 | "/(?:^|$space)({$attribFirst}{$attrib}*) |
341 | 341 | ($space*=$space* |
342 | 342 | (?: |
— | — | @@ -465,8 +465,14 @@ |
466 | 466 | if ( $t != $ot ) { |
467 | 467 | # No match. Push the optional elements back again |
468 | 468 | $badtag = true; |
469 | | - while ( $ot = @array_pop( $optstack ) ) { |
| 469 | + wfSuppressWarnings(); |
| 470 | + $ot = array_pop( $optstack ); |
| 471 | + wfRestoreWarnings(); |
| 472 | + while ( $ot ) { |
470 | 473 | array_push( $tagstack, $ot ); |
| 474 | + wfSuppressWarnings(); |
| 475 | + $ot = array_pop( $optstack ); |
| 476 | + wfRestoreWarnings(); |
471 | 477 | } |
472 | 478 | } |
473 | 479 | } else { |
— | — | @@ -608,7 +614,7 @@ |
609 | 615 | * This does not validate properties, so you should ensure that you call |
610 | 616 | * validateTagAttributes AFTER this to ensure that the resulting style rule |
611 | 617 | * this may add is safe. |
612 | | - * |
| 618 | + * |
613 | 619 | * - Converts most presentational attributes like align into inline css |
614 | 620 | * |
615 | 621 | * @param $attribs Array |
— | — | @@ -617,19 +623,19 @@ |
618 | 624 | */ |
619 | 625 | static function fixDeprecatedAttributes( $attribs, $element ) { |
620 | 626 | global $wgHtml5, $wgCleanupPresentationalAttributes; |
621 | | - |
| 627 | + |
622 | 628 | // presentational attributes were removed from html5, we can leave them |
623 | 629 | // in when html5 is turned off |
624 | 630 | if ( !$wgHtml5 || !$wgCleanupPresentationalAttributes ) { |
625 | 631 | return $attribs; |
626 | 632 | } |
627 | | - |
| 633 | + |
628 | 634 | $table = array( 'table' ); |
629 | 635 | $cells = array( 'td', 'th' ); |
630 | 636 | $colls = array( 'col', 'colgroup' ); |
631 | 637 | $tblocks = array( 'tbody', 'tfoot', 'thead' ); |
632 | 638 | $h = array( 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ); |
633 | | - |
| 639 | + |
634 | 640 | $presentationalAttribs = array( |
635 | 641 | 'align' => array( 'text-align', array_merge( array( 'caption', 'hr', 'div', 'p', 'tr' ), $table, $cells, $colls, $tblocks, $h ) ), |
636 | 642 | 'clear' => array( 'clear', array( 'br' ) ), |
— | — | @@ -640,7 +646,7 @@ |
641 | 647 | 'valign' => array( 'vertical-align', array_merge( $cells, $colls, $tblocks ) ), |
642 | 648 | 'width' => array( 'width', array_merge( array( 'hr', 'pre' ), $table, $cells, $colls ) ), |
643 | 649 | ); |
644 | | - |
| 650 | + |
645 | 651 | // Ensure that any upper case or mixed case attributes are converted to lowercase |
646 | 652 | foreach ( $attribs as $attribute => $value ) { |
647 | 653 | if ( $attribute !== strtolower( $attribute ) && array_key_exists( strtolower( $attribute ), $presentationalAttribs ) ) { |
— | — | @@ -648,45 +654,45 @@ |
649 | 655 | unset( $attribs[$attribute] ); |
650 | 656 | } |
651 | 657 | } |
652 | | - |
| 658 | + |
653 | 659 | $style = ""; |
654 | 660 | foreach ( $presentationalAttribs as $attribute => $info ) { |
655 | 661 | list( $property, $elements ) = $info; |
656 | | - |
| 662 | + |
657 | 663 | // Skip if this attribute is not relevant to this element |
658 | 664 | if ( !in_array( $element, $elements ) ) { |
659 | 665 | continue; |
660 | 666 | } |
661 | | - |
| 667 | + |
662 | 668 | // Skip if the attribute is not used |
663 | 669 | if ( !array_key_exists( $attribute, $attribs ) ) { |
664 | 670 | continue; |
665 | 671 | } |
666 | | - |
| 672 | + |
667 | 673 | $value = $attribs[$attribute]; |
668 | | - |
| 674 | + |
669 | 675 | // For nowrap the value should be nowrap instead of whatever text is in the value |
670 | 676 | if ( $attribute === 'nowrap' ) { |
671 | 677 | $value = 'nowrap'; |
672 | 678 | } |
673 | | - |
| 679 | + |
674 | 680 | // clear="all" is clear: both; in css |
675 | 681 | if ( $attribute === 'clear' && strtolower( $value ) === 'all' ) { |
676 | 682 | $value = 'both'; |
677 | 683 | } |
678 | | - |
| 684 | + |
679 | 685 | // Size based properties should have px applied to them if they have no unit |
680 | 686 | if ( in_array( $attribute, array( 'height', 'width', 'size' ) ) ) { |
681 | 687 | if ( preg_match( '/^[\d.]+$/', $value ) ) { |
682 | 688 | $value = "{$value}px"; |
683 | 689 | } |
684 | 690 | } |
685 | | - |
| 691 | + |
686 | 692 | $style .= " $property: $value;"; |
687 | | - |
| 693 | + |
688 | 694 | unset( $attribs[$attribute] ); |
689 | 695 | } |
690 | | - |
| 696 | + |
691 | 697 | if ( $style ) { |
692 | 698 | // Prepend our style rules so that they can be overridden by user css |
693 | 699 | if ( isset($attribs['style']) ) { |
— | — | @@ -694,7 +700,7 @@ |
695 | 701 | } |
696 | 702 | $attribs['style'] = trim($style); |
697 | 703 | } |
698 | | - |
| 704 | + |
699 | 705 | return $attribs; |
700 | 706 | } |
701 | 707 | |
— | — | @@ -766,7 +772,7 @@ |
767 | 773 | } |
768 | 774 | |
769 | 775 | //RDFa and microdata properties allow URLs, URIs and/or CURIs. check them for sanity |
770 | | - if ( $attribute === 'rel' || $attribute === 'rev' || |
| 776 | + if ( $attribute === 'rel' || $attribute === 'rev' || |
771 | 777 | $attribute === 'about' || $attribute === 'property' || $attribute === 'resource' || #RDFa |
772 | 778 | $attribute === 'datatype' || $attribute === 'typeof' || #RDFa |
773 | 779 | $attribute === 'itemid' || $attribute === 'itemprop' || $attribute === 'itemref' || #HTML5 microdata |
— | — | @@ -774,7 +780,7 @@ |
775 | 781 | |
776 | 782 | //Paranoia. Allow "simple" values but suppress javascript |
777 | 783 | if ( preg_match( self::EVIL_URI_PATTERN, $value ) ) { |
778 | | - continue; |
| 784 | + continue; |
779 | 785 | } |
780 | 786 | } |
781 | 787 | |
— | — | @@ -839,7 +845,7 @@ |
840 | 846 | * returned string may contain character references given certain |
841 | 847 | * clever input strings. These character references must |
842 | 848 | * be escaped before the return value is embedded in HTML. |
843 | | - * |
| 849 | + * |
844 | 850 | * @param $value String |
845 | 851 | * @return String |
846 | 852 | */ |
— | — | @@ -861,7 +867,7 @@ |
862 | 868 | $space = '[\\x20\\t\\r\\n\\f]'; |
863 | 869 | $nl = '(?:\\n|\\r\\n|\\r|\\f)'; |
864 | 870 | $backslash = '\\\\'; |
865 | | - $decodeRegex = "/ $backslash |
| 871 | + $decodeRegex = "/ $backslash |
866 | 872 | (?: |
867 | 873 | ($nl) | # 1. Line continuation |
868 | 874 | ([0-9A-Fa-f]{1,6})$space? | # 2. character number |
— | — | @@ -871,7 +877,7 @@ |
872 | 878 | } |
873 | 879 | $value = preg_replace_callback( $decodeRegex, |
874 | 880 | array( __CLASS__, 'cssDecodeCallback' ), $value ); |
875 | | - |
| 881 | + |
876 | 882 | // Remove any comments; IE gets token splitting wrong |
877 | 883 | // This must be done AFTER decoding character references and |
878 | 884 | // escape sequences, because those steps can introduce comments |
— | — | @@ -1446,7 +1452,7 @@ |
1447 | 1453 | if ( $wgAllowRdfaAttributes ) { |
1448 | 1454 | #RDFa attributes as specified in section 9 of http://www.w3.org/TR/2008/REC-rdfa-syntax-20081014 |
1449 | 1455 | $common = array_merge( $common, array( |
1450 | | - 'about', 'property', 'resource', 'datatype', 'typeof', |
| 1456 | + 'about', 'property', 'resource', 'datatype', 'typeof', |
1451 | 1457 | ) ); |
1452 | 1458 | } |
1453 | 1459 | |
— | — | @@ -1563,7 +1569,7 @@ |
1564 | 1570 | 'th' => array_merge( $common, $tablecell, $tablealign ), |
1565 | 1571 | |
1566 | 1572 | # 12.2 # NOTE: <a> is not allowed directly, but the attrib whitelist is used from the Parser object |
1567 | | - 'a' => array_merge( $common, array( 'href', 'rel', 'rev' ) ), # rel/rev esp. for RDFa |
| 1573 | + 'a' => array_merge( $common, array( 'href', 'rel', 'rev' ) ), # rel/rev esp. for RDFa |
1568 | 1574 | |
1569 | 1575 | # 13.2 |
1570 | 1576 | # Not usually allowed, but may be used for extension-style hooks |
— | — | @@ -1654,7 +1660,7 @@ |
1655 | 1661 | $url = Sanitizer::decodeCharReferences( $url ); |
1656 | 1662 | |
1657 | 1663 | # Escape any control characters introduced by the above step |
1658 | | - $url = preg_replace_callback( '/[\][<>"\\x00-\\x20\\x7F\|]/', |
| 1664 | + $url = preg_replace_callback( '/[\][<>"\\x00-\\x20\\x7F\|]/', |
1659 | 1665 | array( __CLASS__, 'cleanUrlCallback' ), $url ); |
1660 | 1666 | |
1661 | 1667 | # Validate hostname portion |
Index: trunk/phase3/includes/Title.php |
— | — | @@ -2552,7 +2552,7 @@ |
2553 | 2553 | */ |
2554 | 2554 | public function invalidateCache() { |
2555 | 2555 | if ( wfReadOnly() ) { |
2556 | | - return; |
| 2556 | + return false; |
2557 | 2557 | } |
2558 | 2558 | $dbw = wfGetDB( DB_MASTER ); |
2559 | 2559 | $success = $dbw->update( |
Index: trunk/phase3/includes/specials/SpecialSearch.php |
— | — | @@ -35,7 +35,7 @@ |
36 | 36 | * string when applicable. Extensions can add new profiles with hooks |
37 | 37 | * with custom search options just for that profile. |
38 | 38 | * null|string |
39 | | - */ |
| 39 | + */ |
40 | 40 | protected $profile; |
41 | 41 | |
42 | 42 | /// Search engine |
— | — | @@ -497,8 +497,10 @@ |
498 | 498 | $out .= "\n<!-- {$infoLine} -->\n"; |
499 | 499 | } |
500 | 500 | $out .= "<ul class='mw-search-results'>\n"; |
501 | | - while( $result = $matches->next() ) { |
| 501 | + $result = $matches->next(); |
| 502 | + while( $result ) { |
502 | 503 | $out .= $this->showHit( $result, $terms ); |
| 504 | + $result = $matches->next(); |
503 | 505 | } |
504 | 506 | $out .= "</ul>\n"; |
505 | 507 | |
— | — | @@ -717,9 +719,11 @@ |
718 | 720 | } |
719 | 721 | |
720 | 722 | $prev = null; |
721 | | - while( $result = $matches->next() ) { |
| 723 | + $result = $matches->next(); |
| 724 | + while( $result ) { |
722 | 725 | $out .= $this->showInterwikiHit( $result, $prev, $terms, $query, $customCaptions ); |
723 | 726 | $prev = $result->getInterwikiPrefix(); |
| 727 | + $result = $matches->next(); |
724 | 728 | } |
725 | 729 | // TODO: should support paging in a non-confusing way (not sure how though, maybe via ajax).. |
726 | 730 | $out .= "</ul></div>\n"; |
Index: trunk/phase3/includes/Exception.php |
— | — | @@ -70,8 +70,9 @@ |
71 | 71 | $result = null; |
72 | 72 | } |
73 | 73 | |
74 | | - if ( is_string( $result ) ) |
| 74 | + if ( is_string( $result ) ) { |
75 | 75 | return $result; |
| 76 | + } |
76 | 77 | } |
77 | 78 | } |
78 | 79 | |
Index: trunk/phase3/languages/Language.php |
— | — | @@ -3685,7 +3685,7 @@ |
3686 | 3686 | $format['noabbrevs'] ? 'hours' : 'hours-abbrev' )->inLanguage( $this ); |
3687 | 3687 | $daysMsg = wfMessage( |
3688 | 3688 | $format['noabbrevs'] ? 'days' : 'days-abbrev' )->inLanguage( $this ); |
3689 | | - |
| 3689 | + |
3690 | 3690 | if ( round( $seconds * 10 ) < 100 ) { |
3691 | 3691 | $s = $this->formatNum( sprintf( "%.1f", round( $seconds * 10 ) / 10 ) ); |
3692 | 3692 | $s = $secondsMsg->params( $s )->text(); |