r85148 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85147‎ | r85148 | r85149 >
Date:20:11, 1 April 2011
Author:demon
Status:ok (Comments)
Tags:
Comment:
Modified paths:
  • /branches/REL1_17/phase3/RELEASE-NOTES (modified) (history)
  • /branches/REL1_17/phase3/docs/skin.txt (modified) (history)
  • /branches/REL1_17/phase3/includes/AjaxDispatcher.php (modified) (history)
  • /branches/REL1_17/phase3/includes/Article.php (modified) (history)
  • /branches/REL1_17/phase3/includes/BagOStuff.php (modified) (history)
  • /branches/REL1_17/phase3/includes/DjVuImage.php (modified) (history)
  • /branches/REL1_17/phase3/includes/EditPage.php (modified) (history)
  • /branches/REL1_17/phase3/includes/Export.php (modified) (history)
  • /branches/REL1_17/phase3/includes/ExternalEdit.php (modified) (history)
  • /branches/REL1_17/phase3/includes/Linker.php (modified) (history)
  • /branches/REL1_17/phase3/includes/MessageCache.php (modified) (history)
  • /branches/REL1_17/phase3/includes/Title.php (modified) (history)
  • /branches/REL1_17/phase3/includes/User.php (modified) (history)
  • /branches/REL1_17/phase3/includes/api/ApiQueryAllUsers.php (modified) (history)
  • /branches/REL1_17/phase3/includes/db/DatabaseIbm_db2.php (modified) (history)
  • /branches/REL1_17/phase3/includes/diff/DifferenceEngine.php (modified) (history)
  • /branches/REL1_17/phase3/includes/job/RefreshLinksJob.php (modified) (history)
  • /branches/REL1_17/phase3/includes/libs/JavaScriptDistiller.php (modified) (history)
  • /branches/REL1_17/phase3/includes/media/SVGMetadataExtractor.php (modified) (history)
  • /branches/REL1_17/phase3/includes/parser/Parser.php (modified) (history)
  • /branches/REL1_17/phase3/includes/parser/ParserOptions.php (modified) (history)
  • /branches/REL1_17/phase3/includes/parser/Parser_LinkHooks.php (modified) (history)
  • /branches/REL1_17/phase3/includes/parser/Tidy.php (modified) (history)
  • /branches/REL1_17/phase3/includes/resourceloader/ResourceLoader.php (modified) (history)
  • /branches/REL1_17/phase3/includes/resourceloader/ResourceLoaderFileModule.php (modified) (history)
  • /branches/REL1_17/phase3/includes/resourceloader/ResourceLoaderSiteModule.php (modified) (history)
  • /branches/REL1_17/phase3/includes/resourceloader/ResourceLoaderUserModule.php (modified) (history)
  • /branches/REL1_17/phase3/includes/resourceloader/ResourceLoaderWikiModule.php (modified) (history)
  • /branches/REL1_17/phase3/includes/specials/SpecialAllmessages.php (modified) (history)
  • /branches/REL1_17/phase3/languages/LanguageConverter.php (modified) (history)
  • /branches/REL1_17/phase3/languages/classes/LanguageEo.php (modified) (history)
  • /branches/REL1_17/phase3/skins/common/shared.css (modified) (history)
  • /branches/REL1_17/phase3/skins/monobook/main.css (modified) (history)
  • /branches/REL1_17/phase3/skins/vector/screen.css (modified) (history)
  • /branches/REL1_17/phase3/thumb.php (modified) (history)

Diff [purge]

Index: branches/REL1_17/phase3/skins/monobook/main.css
@@ -60,14 +60,7 @@
6161 table {
6262 font-size: 100%;
6363 color: black;
64 - /* we don't want the bottom borders of <h2>s to be visible through
65 - floated tables */
66 - background-color: white;
6764 }
68 -fieldset table {
69 - /* but keep table layouts in forms clean... */
70 - background: none;
71 -}
7265 a {
7366 text-decoration: none;
7467 color: #002bb8;
Index: branches/REL1_17/phase3/skins/common/shared.css
@@ -325,11 +325,7 @@
326326 font-weight: bold;
327327 }
328328
329 -table#mw-search-top-table {
330 - background-color: transparent;
331 -}
332329
333 -
334330 /*
335331 * Advanced PowerSearch box
336332 */
@@ -480,11 +476,7 @@
481477 }
482478
483479 /* Special:Allpages styling */
484 -table.allpageslist {
485 - background-color: transparent;
486 -}
487480 table.mw-allpages-table-form, table.mw-allpages-table-chunk {
488 - background-color: transparent;
489481 width: 100%;
490482 }
491483 td.mw-allpages-alphaindexline {
@@ -503,7 +495,6 @@
504496 table#mw-prefixindex-list-table,
505497 table#mw-prefixindex-nav-table {
506498 width: 98%;
507 - background-color: transparent;
508499 }
509500 td#mw-prefixindex-nav-form {
510501 font-size: smaller;
Property changes on: branches/REL1_17/phase3/skins/common/shared.css
___________________________________________________________________
Modified: svn:mergeinfo
511502 Merged /trunk/phase3/skins/common/shared.css:r80495,80610,80765,81177,81467,81490,81692,81707,81729,81765,81778,81812,81854,81890-81894,81896-81898,81900,81955
Index: branches/REL1_17/phase3/skins/vector/screen.css
@@ -811,14 +811,7 @@
812812 table {
813813 font-size: 100%;
814814 color: black;
815 - /* we don't want the bottom borders of <h2>s to be visible through
816 - * floated tables */
817 - background-color: white;
818815 }
819 -fieldset table {
820 - /* but keep table layouts in forms clean... */
821 - background: none;
822 -}
823816 /* Forms */
824817 fieldset {
825818 border: 1px solid #2f6fab;
Property changes on: branches/REL1_17/phase3/skins/vector/screen.css
___________________________________________________________________
Modified: svn:mergeinfo
826819 Merged /trunk/phase3/skins/vector/screen.css:r80495,80610,80765,81177,81467,81490,81692,81707,81729,81765,81778,81812,81854,81890-81894,81896-81898,81900,81955
Index: branches/REL1_17/phase3/docs/skin.txt
@@ -1,8 +1,9 @@
22 skin.txt
33
4 -MediaWiki's default skin is called Monobook, after the black-and-white photo of
5 -a book, in the page background. This skin has been the default since MediaWiki
6 -1.3 (2004). It is used on Wikipedia, and is popular on other sites.
 4+MediaWiki's default skin is called Vector. This has been the case since
 5+the 1.17 release (2011). This replaces the popular skin, Monobook which
 6+had been been the default since MediaWiki 1.3 (2004). It is now the
 7+default skin on Wikimedia Projects.
78
89 There are three legacy skins which were introduced before MediaWiki 1.3:
910
@@ -15,7 +16,12 @@
1617
1718 * Cologne Blue: A nicer-looking alternative to Standard.
1819
 20+The other skin that is widely used (and is the MediaWiki default before 1.17)
 21+is Monobook.
1922
 23+* Monobook: Named after the black-and-white photo of a book, in the page background.
 24+This was introduced in the 2004 release of 1.3
 25+
2026 And there are four Monobook-derived skins which have been introduced since 1.3:
2127
2228 * MySkin: Monobook without the CSS. The idea is that you customise it using user
@@ -29,7 +35,6 @@
3036
3137 * Modern: An attractive blue/grey theme with sidebar and top bar.
3238
33 -
3439 == Custom CSS/JS ==
3540
3641 It is possible to customise the site CSS and JavaScript without editing any
Index: branches/REL1_17/phase3/includes/User.php
@@ -578,10 +578,13 @@
579579 return false;
580580 }
581581
582 - if( preg_match( '/[' . preg_quote( $wgInvalidUsernameCharacters, '/' ) . ']/', $name ) ) {
583 - wfDebugLog( 'username', __METHOD__ .
584 - ": '$name' invalid due to wgInvalidUsernameCharacters" );
585 - return false;
 582+ // Preg yells if you try to give it an empty string
 583+ if( $wgInvalidUsernameCharacters ) {
 584+ if( preg_match( '/[' . preg_quote( $wgInvalidUsernameCharacters, '/' ) . ']/', $name ) ) {
 585+ wfDebugLog( 'username', __METHOD__ .
 586+ ": '$name' invalid due to wgInvalidUsernameCharacters" );
 587+ return false;
 588+ }
586589 }
587590
588591 return self::isUsableName( $name );
Property changes on: branches/REL1_17/phase3/includes/User.php
___________________________________________________________________
Modified: svn:mergeinfo
589592 Merged /trunk/phase3/includes/User.php:r81729,81765,81778,81812,81854,81890-81894,81896-81898,81900,81955
Index: branches/REL1_17/phase3/includes/BagOStuff.php
@@ -727,6 +727,7 @@
728728
729729 $handle = $this->getReader();
730730 if ( !$handle ) {
 731+ wfProfileOut( __METHOD__ );
731732 return null;
732733 }
733734
@@ -757,6 +758,7 @@
758759
759760 $handle = $this->getWriter();
760761 if ( !$handle ) {
 762+ wfProfileOut( __METHOD__ );
761763 return false;
762764 }
763765
@@ -773,6 +775,7 @@
774776
775777 $handle = $this->getWriter();
776778 if ( !$handle ) {
 779+ wfProfileOut( __METHOD__ );
777780 return false;
778781 }
779782
@@ -791,6 +794,7 @@
792795 $handle = $this->getWriter();
793796
794797 if ( !$handle ) {
 798+ wfProfileOut( __METHOD__ );
795799 return false;
796800 }
797801
Index: branches/REL1_17/phase3/includes/diff/DifferenceEngine.php
@@ -150,6 +150,8 @@
151151 URL=$url2
152152 CONTROL;
153153 echo( $control );
 154+
 155+ wfProfileOut( __METHOD__ );
154156 return;
155157 }
156158
@@ -620,16 +622,20 @@
621623 $this->mCacheHit = true;
622624 // Check if the diff should be hidden from this user
623625 if ( !$this->loadRevisionData() ) {
 626+ wfProfileOut( __METHOD__ );
624627 return false;
625628 } elseif ( $this->mOldRev && !$this->mOldRev->userCan( Revision::DELETED_TEXT ) ) {
 629+ wfProfileOut( __METHOD__ );
626630 return false;
627631 } elseif ( $this->mNewRev && !$this->mNewRev->userCan( Revision::DELETED_TEXT ) ) {
 632+ wfProfileOut( __METHOD__ );
628633 return false;
629634 }
630635 // Short-circuit
631636 if ( $this->mOldRev && $this->mNewRev
632637 && $this->mOldRev->getID() == $this->mNewRev->getID() )
633638 {
 639+ wfProfileOut( __METHOD__ );
634640 return '';
635641 }
636642 // Cacheable?
@@ -757,6 +763,7 @@
758764 wfProfileOut( __METHOD__ . "-shellexec" );
759765 unlink( $tempName1 );
760766 unlink( $tempName2 );
 767+ wfProfileOut( __METHOD__ );
761768 return $difftext;
762769 }
763770
@@ -765,7 +772,9 @@
766773 $nta = explode( "\n", $wgContLang->segmentForDiff( $ntext ) );
767774 $diffs = new Diff( $ota, $nta );
768775 $formatter = new TableDiffFormatter();
769 - return $wgContLang->unsegmentForDiff( $formatter->format( $diffs ) ) .
 776+ $difftext = $wgContLang->unsegmentForDiff( $formatter->format( $diffs ) ) .
 777+ wfProfileOut( __METHOD__ );
 778+ return $difftext;
770779 $this->debug();
771780 }
772781
Index: branches/REL1_17/phase3/includes/Article.php
@@ -1908,6 +1908,7 @@
19091909 if ( !$rev ) {
19101910 wfDebug( "Article::replaceSection asked for bogus section (page: " .
19111911 $this->getId() . "; section: $section; edittime: $edittime)\n" );
 1912+ wfProfileOut( __METHOD__ );
19121913 return null;
19131914 }
19141915
@@ -2089,12 +2090,12 @@
20902091 $flags & EDIT_MINOR, null, null, &$flags, &$status ) ) )
20912092 {
20922093 wfDebug( __METHOD__ . ": ArticleSave hook aborted save!\n" );
2093 - wfProfileOut( __METHOD__ );
20942094
20952095 if ( $status->isOK() ) {
20962096 $status->fatal( 'edit-hook-aborted' );
20972097 }
20982098
 2099+ wfProfileOut( __METHOD__ );
20992100 return $status;
21002101 }
21012102
Property changes on: branches/REL1_17/phase3/includes/Article.php
___________________________________________________________________
Modified: svn:mergeinfo
21022103 Merged /trunk/phase3/includes/Article.php:r81729,81765,81778,81812,81854,81890-81894,81896-81898,81900,81955
Index: branches/REL1_17/phase3/includes/parser/Tidy.php
@@ -118,15 +118,13 @@
119119 $retval = -1;
120120 }
121121
122 - wfProfileOut( __METHOD__ );
123 -
124122 if( !$stderr && $cleansource == '' && $text != '' ) {
125123 // Some kind of error happened, so we couldn't get the corrected text.
126124 // Just give up; we'll use the source text and append a warning.
127 - return null;
128 - } else {
129 - return $cleansource;
 125+ $cleansource = null;
130126 }
 127+ wfProfileOut( __METHOD__ );
 128+ return $cleansource;
131129 }
132130
133131 /**
@@ -144,6 +142,7 @@
145143
146144 if( $stderr ) {
147145 $retval = $tidy->getStatus();
 146+ wfProfileOut( __METHOD__ );
148147 return $tidy->errorBuffer;
149148 } else {
150149 $tidy->cleanRepair();
Index: branches/REL1_17/phase3/includes/parser/Parser.php
@@ -2422,6 +2422,7 @@
24232423 }
24242424 if ( $stack > 0 ) {
24252425 wfDebug( __METHOD__.": Invalid input; not enough close tags (stack $stack, state $state)\n" );
 2426+ wfProfileOut( __METHOD__ );
24262427 return false;
24272428 }
24282429 wfProfileOut( __METHOD__ );
Property changes on: branches/REL1_17/phase3/includes/parser/Parser.php
___________________________________________________________________
Modified: svn:mergeinfo
24292430 Merged /trunk/phase3/includes/parser/Parser.php:r81729,81765,81778,81812,81854,81890-81894,81896-81898,81900,81955
Index: branches/REL1_17/phase3/includes/parser/Parser_LinkHooks.php
@@ -265,9 +265,10 @@
266266 if( $return === false ) {
267267 # False (no link) was returned, output plain wikitext
268268 # Build it again as the hook is allowed to modify $paramText
269 - return isset($paramText) ? "[[$titleText|$paramText]]" : "[[$titleText]]";
 269+ $return = isset($paramText) ? "[[$titleText|$paramText]]" : "[[$titleText]]";
270270 }
271271 # Content was returned, return it
 272+ wfProfileOut( __METHOD__ );
272273 return $return;
273274 }
274275
Index: branches/REL1_17/phase3/includes/parser/ParserOptions.php
@@ -281,7 +281,7 @@
282282 // since it disables the parser cache, its value will always
283283 // be 0 when this function is called by parsercache.
284284 // The conditional is here to avoid a confusing 0
285 - if ( in_array( 'stubthreshold', $forOptions ) )
 285+ if ( true || in_array( 'stubthreshold', $forOptions ) )
286286 $confstr .= '!0' ;
287287 else
288288 $confstr .= '!*' ;
Index: branches/REL1_17/phase3/includes/MessageCache.php
@@ -376,6 +376,10 @@
377377 global $wgMaxMsgCacheEntrySize;
378378 wfProfileIn( __METHOD__ );
379379
 380+ if ( $this->mDisable ) {
 381+ wfProfileOut( __METHOD__ );
 382+ return;
 383+ }
380384
381385 list( $msg, $code ) = $this->figureMessage( $title );
382386
Index: branches/REL1_17/phase3/includes/Linker.php
@@ -720,6 +720,7 @@
721721 return $this->linkKnown( $title, "$prefix$text$inside", array(), $query ) . $trail;
722722 }
723723 } else {
 724+ wfProfileOut( __METHOD__ );
724725 return "<!-- ERROR -->{$prefix}{$text}{$trail}";
725726 }
726727 }
@@ -1670,12 +1671,17 @@
16711672 * escape), or false for no accesskey attribute
16721673 */
16731674 public function accesskey( $name ) {
 1675+ if ( isset( $this->accesskeycache[$name] ) ) {
 1676+ return $this->accesskeycache[$name];
 1677+ }
16741678 wfProfileIn( __METHOD__ );
16751679
1676 - if ( wfEmptyMsg( "accesskey-$name" ) ) {
 1680+ $message = wfMessage( "accesskey-$name" );
 1681+
 1682+ if ( !$message->exists() ) {
16771683 $accesskey = false;
16781684 } else {
1679 - $accesskey = wfMsg( "accesskey-$name" );
 1685+ $accesskey = $message->plain();
16801686 if ( $accesskey === '' || $accesskey === '-' ) {
16811687 # FIXME: Per standard MW behavior, a value of '-' means to suppress the
16821688 # attribute, but this is broken for accesskey: that might be a useful
@@ -1685,7 +1691,7 @@
16861692 }
16871693
16881694 wfProfileOut( __METHOD__ );
1689 - return $accesskey;
 1695+ return $this->accesskeycache[$name] = $accesskey;
16901696 }
16911697
16921698 /**
Index: branches/REL1_17/phase3/includes/ExternalEdit.php
@@ -53,6 +53,11 @@
5454 }
5555 $special=$wgLang->getNsText(NS_SPECIAL);
5656 $control = <<<CONTROL
 57+; You're seeing this file because you're using Mediawiki's External Editor
 58+; feature. This is probably because you selected use external editor
 59+; in your preferences. To edit normally, either disable that preference
 60+; or go to the URL $url .
 61+; See http://www.mediawiki.org/wiki/Manual:External_editors for details.
5762 [Process]
5863 Type=$type
5964 Engine=MediaWiki
Index: branches/REL1_17/phase3/includes/AjaxDispatcher.php
@@ -133,7 +133,7 @@
134134 }
135135 }
136136
 137+ $wgOut = null;
137138 wfProfileOut( __METHOD__ );
138 - $wgOut = null;
139139 }
140140 }
Index: branches/REL1_17/phase3/includes/db/DatabaseIbm_db2.php
@@ -367,6 +367,7 @@
368368 "Server: $server, Database: $dbName, User: $user, Password: "
369369 . substr( $password, 0, 3 ) . "...\n" );
370370 $this->installPrint( $this->lastError() . "\n" );
 371+
371372 wfProfileOut( __METHOD__ );
372373 return null;
373374 }
Index: branches/REL1_17/phase3/includes/Export.php
@@ -177,8 +177,8 @@
178178 "</id>" .
179179 "</contributor>";
180180 }
 181+ $this->author_list .= "</contributors>";
181182 wfProfileOut( __METHOD__ );
182 - $this->author_list .= "</contributors>";
183183 }
184184
185185 protected function dumpFrom( $cond = '' ) {
Index: branches/REL1_17/phase3/includes/EditPage.php
@@ -659,10 +659,10 @@
660660 // Custom edit intro for new sections
661661 $this->section === 'new' ? 'MediaWiki:addsection-editintro' : '' );
662662
663 - wfProfileOut( __METHOD__ );
664 -
665663 // Allow extensions to modify form data
666664 wfRunHooks( 'EditPage::importFormData', array( $this, $request ) );
 665+
 666+ wfProfileOut( __METHOD__ );
667667 }
668668
669669 /**
@@ -788,6 +788,8 @@
789789
790790 if ( !wfRunHooks( 'EditPage::attemptSave', array( $this ) ) ) {
791791 wfDebug( "Hook 'EditPage::attemptSave' aborted article saving\n" );
 792+ wfProfileOut( __METHOD__ . '-checks' );
 793+ wfProfileOut( __METHOD__ );
792794 return self::AS_HOOK_ERROR;
793795 }
794796
@@ -795,11 +797,12 @@
796798 if ( $this->mTitle->getNamespace() == NS_FILE &&
797799 Title::newFromRedirect( $this->textbox1 ) instanceof Title &&
798800 !$wgUser->isAllowed( 'upload' ) ) {
799 - if ( $wgUser->isAnon() ) {
800 - return self::AS_IMAGE_REDIRECT_ANON;
801 - } else {
802 - return self::AS_IMAGE_REDIRECT_LOGGED;
803 - }
 801+ $isAnon = $wgUser->isAnon();
 802+
 803+ wfProfileOut( __METHOD__ . '-checks' );
 804+ wfProfileOut( __METHOD__ );
 805+
 806+ return $isAnon ? self::AS_IMAGE_REDIRECT_ANON : self::AS_IMAGE_REDIRECT_LOGGED;
804807 }
805808
806809 # Check for spam
@@ -1220,8 +1223,10 @@
12211224 # Enabled article-related sidebar, toplinks, etc.
12221225 $wgOut->setArticleRelated( true );
12231226
1224 - if ( $this->showHeader() === false )
 1227+ if ( $this->showHeader() === false ) {
 1228+ wfProfileOut( __METHOD__ );
12251229 return;
 1230+ }
12261231
12271232 $action = htmlspecialchars( $this->getActionURL( $wgTitle ) );
12281233
@@ -1873,8 +1878,10 @@
18741879 if ( $wgRawHtml && !$this->mTokenOk ) {
18751880 // Could be an offsite preview attempt. This is very unsafe if
18761881 // HTML is enabled, as it could be an attack.
1877 - return $wgOut->parse( "<div class='previewnote'>" .
 1882+ $parsedNote = $wgOut->parse( "<div class='previewnote'>" .
18781883 wfMsg( 'session_fail_preview_html' ) . "</div>" );
 1884+ wfProfileOut( __METHOD__ );
 1885+ return $parsedNote;
18791886 }
18801887
18811888 # don't parse user css/js, show message about preview
Index: branches/REL1_17/phase3/includes/api/ApiQueryAllUsers.php
@@ -35,7 +35,6 @@
3636 * @ingroup API
3737 */
3838 class ApiQueryAllUsers extends ApiQueryBase {
39 -
4039 public function __construct( $query, $moduleName ) {
4140 parent::__construct( $query, $moduleName, 'au' );
4241 }
@@ -52,7 +51,7 @@
5352 $fld_groups = isset( $prop['groups'] );
5453 $fld_registration = isset( $prop['registration'] );
5554 } else {
56 - $fld_blockinfo = $fld_editcount = $fld_groups = $fld_registration = false;
 55+ $fld_blockinfo = $fld_editcount = $fld_groups = $fld_registration = $fld_rights = false;
5756 }
5857
5958 $limit = $params['limit'];
Index: branches/REL1_17/phase3/includes/resourceloader/ResourceLoaderSiteModule.php
@@ -36,15 +36,14 @@
3737 global $wgHandheldStyle;
3838
3939 $pages = array(
40 - 'Common.js' => array( 'ns' => NS_MEDIAWIKI, 'type' => 'script' ),
41 - 'Common.css' => array( 'ns' => NS_MEDIAWIKI, 'type' => 'style' ),
42 - ucfirst( $context->getSkin() ) . '.js' => array( 'ns' => NS_MEDIAWIKI, 'type' => 'script' ),
43 - ucfirst( $context->getSkin() ) . '.css' => array( 'ns' => NS_MEDIAWIKI, 'type' => 'style' ),
44 - 'Print.css' => array( 'ns' => NS_MEDIAWIKI, 'type' => 'style', 'media' => 'print' ),
 40+ 'MediaWiki:Common.js' => array( 'type' => 'script' ),
 41+ 'MediaWiki:Common.css' => array( 'type' => 'style' ),
 42+ 'MediaWiki:' . ucfirst( $context->getSkin() ) . '.js' => array( 'type' => 'script' ),
 43+ 'MediaWiki:' . ucfirst( $context->getSkin() ) . '.css' => array( 'type' => 'style' ),
 44+ 'MediaWiki:Print.css' => array( 'type' => 'style', 'media' => 'print' ),
4545 );
4646 if ( $wgHandheldStyle ) {
47 - $pages['Handheld.css'] = array(
48 - 'ns' => NS_MEDIAWIKI,
 47+ $pages['MediaWiki:Handheld.css'] = array(
4948 'type' => 'style',
5049 'media' => 'handheld' );
5150 }
Index: branches/REL1_17/phase3/includes/resourceloader/ResourceLoader.php
@@ -206,6 +206,7 @@
207207 foreach ( $name as $key => $value ) {
208208 $this->register( $key, $value );
209209 }
 210+ wfProfileOut( __METHOD__ );
210211 return;
211212 }
212213
@@ -441,6 +442,7 @@
442443 return '/* No modules requested. Max made me put this here */';
443444 }
444445
 446+ wfProfileIn( __METHOD__ );
445447 // Pre-fetch blobs
446448 if ( $context->shouldIncludeMessages() ) {
447449 try {
@@ -521,15 +523,16 @@
522524 }
523525 }
524526
525 - if ( $context->getDebug() ) {
526 - return $exceptions . $out;
527 - } else {
 527+ if ( !$context->getDebug() ) {
528528 if ( $context->getOnly() === 'styles' ) {
529 - return $exceptions . $this->filter( 'minify-css', $out );
 529+ $out = $this->filter( 'minify-css', $out );
530530 } else {
531 - return $exceptions . $this->filter( 'minify-js', $out );
 531+ $out = $this->filter( 'minify-js', $out );
532532 }
533533 }
 534+
 535+ wfProfileOut( __METHOD__ );
 536+ return $exceptions . $out;
534537 }
535538
536539 /* Static Methods */
Property changes on: branches/REL1_17/phase3/includes/resourceloader/ResourceLoader.php
___________________________________________________________________
Modified: svn:mergeinfo
537540 Merged /trunk/phase3/includes/resourceloader/ResourceLoader.php:r81729,81765,81778,81812,81854,81890-81894,81896-81898,81900,81955
Index: branches/REL1_17/phase3/includes/resourceloader/ResourceLoaderUserModule.php
@@ -31,12 +31,12 @@
3232 if ( $context->getUser() ) {
3333 $username = $context->getUser();
3434 return array(
35 - "$username/common.js" => array( 'ns' => NS_USER, 'type' => 'script' ),
36 - "$username/" . $context->getSkin() . '.js' =>
37 - array( 'ns' => NS_USER, 'type' => 'script' ),
38 - "$username/common.css" => array( 'ns' => NS_USER, 'type' => 'style' ),
39 - "$username/" . $context->getSkin() . '.css' =>
40 - array( 'ns' => NS_USER, 'type' => 'style' ),
 35+ "User:$username/common.js" => array( 'type' => 'script' ),
 36+ "User:$username/" . $context->getSkin() . '.js' =>
 37+ array( 'type' => 'script' ),
 38+ "User:$username/common.css" => array( 'type' => 'style' ),
 39+ "User:$username/" . $context->getSkin() . '.css' =>
 40+ array( 'type' => 'style' ),
4141 );
4242 }
4343 return array();
Index: branches/REL1_17/phase3/includes/resourceloader/ResourceLoaderFileModule.php
@@ -355,6 +355,7 @@
356356 // If a module is nothing but a list of dependencies, we need to avoid
357357 // giving max() an empty array
358358 if ( count( $files ) === 0 ) {
 359+ wfProfileOut( __METHOD__ );
359360 return $this->modifiedTime[$context->getHash()] = 1;
360361 }
361362
@@ -364,6 +365,7 @@
365366 $this->modifiedTime[$context->getHash()] = max(
366367 $filesMtime,
367368 $this->getMsgBlobMtime( $context->getLanguage() ) );
 369+
368370 wfProfileOut( __METHOD__ );
369371 return $this->modifiedTime[$context->getHash()];
370372 }
Index: branches/REL1_17/phase3/includes/resourceloader/ResourceLoaderWikiModule.php
@@ -42,12 +42,12 @@
4343
4444 /* Protected Methods */
4545
46 - protected function getContent( $page, $ns ) {
47 - if ( $ns === NS_MEDIAWIKI ) {
48 - return wfEmptyMsg( $page ) ? '' : wfMsgExt( $page, 'content' );
 46+ protected function getContent( $title ) {
 47+ if ( $title->getNamespace() === NS_MEDIAWIKI ) {
 48+ $dbkey = $title->getDBkey();
 49+ return wfEmptyMsg( $dbkey ) ? '' : wfMsgExt( $dbkey, 'content' );
4950 }
50 - $title = Title::newFromText( $page, $ns );
51 - if ( !$title || !$title->isCssJsSubpage() ) {
 51+ if ( !$title->isCssJsSubpage() ) {
5252 return null;
5353 }
5454 $revision = Revision::newFromTitle( $title );
@@ -61,15 +61,21 @@
6262
6363 public function getScript( ResourceLoaderContext $context ) {
6464 $scripts = '';
65 - foreach ( $this->getPages( $context ) as $page => $options ) {
 65+ foreach ( $this->getPages( $context ) as $titleText => $options ) {
6666 if ( $options['type'] !== 'script' ) {
6767 continue;
6868 }
69 - $script = $this->getContent( $page, $options['ns'] );
70 - if ( $script ) {
71 - $ns = MWNamespace::getCanonicalName( $options['ns'] );
72 - $scripts .= "/* $ns:$page */\n$script\n";
 69+ $title = Title::newFromText( $titleText );
 70+ if ( !$title ) {
 71+ continue;
7372 }
 73+ $script = $this->getContent( $title );
 74+ if ( strval( $script ) !== '' ) {
 75+ if ( strpos( $titleText, '*/' ) === false ) {
 76+ $scripts .= "/* $titleText */\n";
 77+ }
 78+ $scripts .= $script . "\n";
 79+ }
7480 }
7581 return $scripts;
7682 }
@@ -77,13 +83,17 @@
7884 public function getStyles( ResourceLoaderContext $context ) {
7985
8086 $styles = array();
81 - foreach ( $this->getPages( $context ) as $page => $options ) {
 87+ foreach ( $this->getPages( $context ) as $titleText => $options ) {
8288 if ( $options['type'] !== 'style' ) {
8389 continue;
8490 }
 91+ $title = Title::newFromText( $titleText );
 92+ if ( !$title ) {
 93+ continue;
 94+ }
8595 $media = isset( $options['media'] ) ? $options['media'] : 'all';
86 - $style = $this->getContent( $page, $options['ns'] );
87 - if ( !$style ) {
 96+ $style = $this->getContent( $title );
 97+ if ( strval( $style ) === '' ) {
8898 continue;
8999 }
90100 if ( $this->getFlip( $context ) ) {
@@ -92,8 +102,10 @@
93103 if ( !isset( $styles[$media] ) ) {
94104 $styles[$media] = '';
95105 }
96 - $ns = MWNamespace::getCanonicalName( $options['ns'] );
97 - $styles[$media] .= "/* $ns:$page */\n$style\n";
 106+ if ( strpos( $titleText, '*/' ) === false ) {
 107+ $styles[$media] .= "/* $titleText */\n";
 108+ }
 109+ $styles[$media] .= $style . "\n";
98110 }
99111 return $styles;
100112 }
@@ -104,17 +116,16 @@
105117 return $this->modifiedTime[$hash];
106118 }
107119
108 - $titles = array();
109 - foreach ( $this->getPages( $context ) as $page => $options ) {
110 - $titles[$options['ns']][$page] = true;
 120+ $batch = new LinkBatch;
 121+ foreach ( $this->getPages( $context ) as $titleText => $options ) {
 122+ $batch->addObj( Title::newFromText( $titleText ) );
111123 }
112124
113125 $modifiedTime = 1; // wfTimestamp() interprets 0 as "now"
114 -
115 - if ( $titles ) {
 126+ if ( !$batch->isEmpty() ) {
116127 $dbr = wfGetDB( DB_SLAVE );
117128 $latest = $dbr->selectField( 'page', 'MAX(page_touched)',
118 - $dbr->makeWhereFrom2d( $titles, 'page_namespace', 'page_title' ),
 129+ $batch->constructSet( 'page', $dbr ),
119130 __METHOD__ );
120131
121132 if ( $latest ) {
@@ -122,6 +133,7 @@
123134 }
124135 }
125136
126 - return $this->modifiedTime[$hash] = $modifiedTime;
 137+ $this->modifiedTime[$hash] = $modifiedTime;
 138+ return $modifiedTime;
127139 }
128140 }
Index: branches/REL1_17/phase3/includes/media/SVGMetadataExtractor.php
@@ -48,7 +48,7 @@
4949 */
5050 function __construct( $source ) {
5151 $this->reader = new XMLReader();
52 - $this->reader->open( $source );
 52+ $this->reader->open( $source, null, LIBXML_NOERROR | LIBXML_NOWARNING );
5353
5454 $this->metadata['width'] = self::DEFAULT_WIDTH;
5555 $this->metadata['height'] = self::DEFAULT_HEIGHT;
Index: branches/REL1_17/phase3/includes/Title.php
@@ -2104,8 +2104,6 @@
21052105 Title::purgeExpiredRestrictions();
21062106 }
21072107
2108 - wfProfileOut( __METHOD__ );
2109 -
21102108 if ( $getPages ) {
21112109 $this->mCascadeSources = $sources;
21122110 $this->mCascadingRestrictions = $pagerestrictions;
@@ -2113,6 +2111,7 @@
21142112 $this->mHasCascadingRestrictions = $sources;
21152113 }
21162114
 2115+ wfProfileOut( __METHOD__ );
21172116 return array( $sources, $pagerestrictions );
21182117 }
21192118
Property changes on: branches/REL1_17/phase3/includes/Title.php
___________________________________________________________________
Modified: svn:mergeinfo
21202119 Merged /trunk/phase3/includes/Title.php:r81729,81765,81778,81812,81854,81890-81894,81896-81898,81900,81955
Index: branches/REL1_17/phase3/includes/job/RefreshLinksJob.php
@@ -99,6 +99,8 @@
100100 $jobs[] = new RefreshLinksJob( $title, '' );
101101 }
102102 Job::batchInsert( $jobs );
 103+
 104+ wfProfileOut( __METHOD__ );
103105 return true;
104106 }
105107 # Re-parse each page that transcludes this page and update their tracking links...
Index: branches/REL1_17/phase3/includes/libs/JavaScriptDistiller.php
@@ -77,8 +77,8 @@
7878 // Protect strings. The original code had [^\'\\v] here, but that didn't armor multiline
7979 // strings correctly. This also armors multiline strings that don't have backslashes at the
8080 // end of the line (these are invalid), but that's fine because we're just armoring here.
81 - $parser->add( '/\'[^\']*\'/', '$1' );
82 - $parser->add( '/"[^"]*"/', '$1' );
 81+ $parser->add( '/\'([^\'\\\\]*(\\\\.[^\'\\\\]*)*)\'/', '$1' );
 82+ $parser->add( '/"([^"\\\\]*(\\\\.[^"\\\\]*)*)"/', '$1' );
8383 // Protect regular expressions
8484 $parser->add( '/[ \\t]+(\\/[^\\/\\r\\n\\*][^\\/\\r\\n]*\\/g?i?)/', '$2' );
8585 $parser->add( '/[^\\w\\$\\/\'"*)\\?:]\\/[^\\/\\r\\n\\*][^\\/\\r\\n]*\\/g?i?/', '$1' );
Index: branches/REL1_17/phase3/includes/specials/SpecialAllmessages.php
@@ -202,8 +202,8 @@
203203
204204 // Normalise message names so they look like page titles
205205 $messageNames = array_map( array( $this->lang, 'ucfirst' ), $messageNames );
206 - wfProfileIn( __METHOD__ );
207206
 207+ wfProfileOut( __METHOD__ );
208208 return $messageNames;
209209 }
210210
Index: branches/REL1_17/phase3/includes/DjVuImage.php
@@ -226,6 +226,8 @@
227227 */
228228 function retrieveMetaData() {
229229 global $wgDjvuToXML, $wgDjvuDump, $wgDjvuTxt;
 230+ wfProfileIn( __METHOD__ );
 231+
230232 if ( isset( $wgDjvuDump ) ) {
231233 # djvudump is faster as of version 3.5
232234 # http://sourceforge.net/tracker/index.php?func=detail&aid=1704049&group_id=32953&atid=406583
@@ -272,6 +274,7 @@
273275 $xml = $xml . $txt. '</mw-djvu>' ;
274276 }
275277 }
 278+ wfProfileOut( __METHOD__ );
276279 return $xml;
277280 }
278281
Index: branches/REL1_17/phase3/thumb.php
@@ -56,11 +56,13 @@
5757 $bits = explode( '!', $fileName, 2 );
5858 if( !isset($bits[1]) ) {
5959 wfThumbError( 404, wfMsg( 'badtitletext' ) );
 60+ wfProfileOut( __METHOD__ );
6061 return;
6162 }
6263 $title = Title::makeTitleSafe( NS_FILE, $bits[1] );
6364 if( is_null($title) ) {
6465 wfThumbError( 404, wfMsg( 'badtitletext' ) );
 66+ wfProfileOut( __METHOD__ );
6567 return;
6668 }
6769 $img = RepoGroup::singleton()->getLocalRepo()->newFromArchiveName( $title, $fileName );
@@ -73,6 +75,7 @@
7476 if ( !$img->getTitle()->userCanRead() ) {
7577 wfThumbError( 403, 'Access denied. You do not have permission to access ' .
7678 'the source file.' );
 79+ wfProfileOut( __METHOD__ );
7780 return;
7881 }
7982 $headers[] = 'Cache-Control: private';
@@ -81,15 +84,18 @@
8285
8386 if ( !$img ) {
8487 wfThumbError( 404, wfMsg( 'badtitletext' ) );
 88+ wfProfileOut( __METHOD__ );
8589 return;
8690 }
8791 if ( !$img->exists() ) {
8892 wfThumbError( 404, 'The source file for the specified thumbnail does not exist.' );
 93+ wfProfileOut( __METHOD__ );
8994 return;
9095 }
9196 $sourcePath = $img->getPath();
9297 if ( $sourcePath === false ) {
9398 wfThumbError( 500, 'The source file is not locally accessible.' );
 99+ wfProfileOut( __METHOD__ );
94100 return;
95101 }
96102
@@ -105,6 +111,7 @@
106112 wfRestoreWarnings();
107113 if ( $stat['mtime'] <= $imsUnix ) {
108114 header( 'HTTP/1.1 304 Not Modified' );
 115+ wfProfileOut( __METHOD__ );
109116 return;
110117 }
111118 }
@@ -116,11 +123,13 @@
117124
118125 if ( is_file( $thumbPath ) ) {
119126 wfStreamFile( $thumbPath, $headers );
 127+ wfProfileOut( __METHOD__ );
120128 return;
121129 }
122130 }
123131 } catch ( MWException $e ) {
124132 wfThumbError( 500, $e->getHTML() );
 133+ wfProfileOut( __METHOD__ );
125134 return;
126135 }
127136
Index: branches/REL1_17/phase3/languages/LanguageConverter.php
@@ -345,6 +345,7 @@
346346 if ( !$toVariant ) {
347347 $toVariant = $this->getPreferredVariant();
348348 if ( !$toVariant ) {
 349+ wfProfileOut( __METHOD__ );
349350 return $text;
350351 }
351352 }
Property changes on: branches/REL1_17/phase3/languages/LanguageConverter.php
___________________________________________________________________
Modified: svn:mergeinfo
352353 Merged /trunk/phase3/languages/LanguageConverter.php:r81729,81765,81778,81812,81854,81890-81894,81896-81898,81900,81955
Index: branches/REL1_17/phase3/languages/classes/LanguageEo.php
@@ -41,7 +41,7 @@
4242 if ( strcasecmp( $in, 'x' ) == 0 && strcasecmp( $out, 'utf-8' ) == 0 ) {
4343 return preg_replace_callback (
4444 '/([cghjsu]x?)((?:xx)*)(?!x)/i',
45 - array( $this, 'strrtuxCallback' ), $string );
 45+ array( $this, 'strrtxuCallback' ), $string );
4646 } else if ( strcasecmp( $in, 'UTF-8' ) == 0 && strcasecmp( $out, 'x' ) == 0 ) {
4747 # Double Xs only if they follow cxapelutaj literoj.
4848 return preg_replace_callback(
Property changes on: branches/REL1_17/phase3/languages/classes/LanguageEo.php
___________________________________________________________________
Modified: svn:mergeinfo
4949 Merged /trunk/phase3/languages/classes/LanguageEo.php:r81729,81765,81778,81812,81854,81890-81894,81896-81898,81900,81955
Index: branches/REL1_17/phase3/RELEASE-NOTES
@@ -504,6 +504,12 @@
505505 redirect revision with no page.
506506 * (bug 15641) Fixed permissions checks in Special:Import which allowed users without
507507 the 'import' permission to import pages from configured import sources.
 508+* (bug 26449) Keep underlines from headings outside of tables and thumbs by
 509+ adding overflow:hidden to h1,h2,h3,h4,h5,h6 (also fixes editsection bunching).
 510+* (bug 26708) Remove background-color:white from tables in Monobook and Vector.
 511+* (bug 26781) {{PAGENAME}} and related parser functions escape their output better.
 512+* (bug 26716) Provide link to instructions for external editor related preferences
 513+ and add a comment to the ini control file explaining what is going on.
508514
509515 === API changes in 1.17 ===
510516 * BREAKING CHANGE: action=patrol now requires POST
@@ -633,9 +639,9 @@
634640 * Rusyn (rue) (new)
635641
636642 * (bug 23156) Commafy and search normalization updated for Belarusian
637 - (Taraškievica).
638 -* (bug 23283) Native name for Old English -> Ænglisc.
639 -* (bug 23364) Native name for Azerbaijani -> Azərbaycanca.
 643+ (Tara�kievica).
 644+* (bug 23283) Native name for Old English -> �nglisc.
 645+* (bug 23364) Native name for Azerbaijani -> Az?rbaycanca.
640646 * (bug 24593) Native name for Sorani now uses only Arabic script.
641647 * (bug 24628) Generic translations for NS_USER/NS_USER_TALK for Esperanto.
642648 * (bug 24917) Polish as fallback for Kashubia.
Property changes on: branches/REL1_17/phase3/RELEASE-NOTES
___________________________________________________________________
Modified: svn:mergeinfo
643649 Merged /trunk/phase3/RELEASE-NOTES:r80495,80610,80765,81177,81467,81490,81692,81707,81729,81765,81778,81812,81854,81890-81894,81896-81898,81900,81955

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r48184Localisation updates for extension messages from translatewiki.net (2009-03-0...raymond20:35, 8 March 2009
r80495This override is no longer needed. ...krinkle15:33, 18 January 2011
r80610(bug 26716, well partially anyways. kind of second half of r80608) Add a comm...bawolff01:49, 20 January 2011
r80765This override is no longer needed. white background for tables removed in r80...krinkle20:30, 22 January 2011
r81177Removing more, no longer needed, overrides for the white table background (w...krinkle23:30, 28 January 2011
r81490Fixup r81467reedy22:06, 3 February 2011
r81692Fixes for ResourceLoaderWikiModule r72776. No serious bugs found, do not merg...tstarling06:34, 8 February 2011
r81707Reimplement r80900, was lost when code was moved aroundcatrope10:26, 8 February 2011
r81729Make SVGMetadataExtractor less noisy when it reads SVGs from Adobe Illustrator.tstarling12:25, 8 February 2011
r81765Hack to shortcut it to zero until User::getStubThreshold() produces a call to...platonides17:58, 8 February 2011
r81778Add missing wfProfileOut( __METHOD__ );reedy22:01, 8 February 2011
r81812preg_match() yells about undefined offsets when $wgInvalidUsernameCharacters ...demon13:42, 9 February 2011
r81854Explicitally define $fld_rights on all code pathsreedy22:42, 9 February 2011
r81890Add missing wfProfileOutplatonides15:47, 10 February 2011
r81891Close wfProfileIn()splatonides15:53, 10 February 2011
r81892More wfProfileOut()ingplatonides16:04, 10 February 2011
r81893Fix profilingnikerabbit16:08, 10 February 2011
r81896Yet more additions of wfProfileOut()platonides16:39, 10 February 2011
r81897Add profiling to DjVuImage::retrieveMetaDataplatonides16:40, 10 February 2011
r81898Add profiling to the whole ResourceLoader::makeModuleResponseplatonides16:44, 10 February 2011
r81900Fix the wrong merge of r81894 after r81893platonides16:47, 10 February 2011
r81955Merge callback fixes from 1.17wmf1. /e is evil.demon10:27, 11 February 2011

Comments

#Comment by Catrope (talk | contribs)   21:23, 2 April 2011

r48184  ?!?

#Comment by Catrope (talk | contribs)   21:45, 2 April 2011

Also merges r78995 and some harmless profiling changes.

Status & tagging log