r91886 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91885‎ | r91886 | r91887 >
Date:16:53, 11 July 2011
Author:robin
Status:ok (Comments)
Tags:
Comment:
(bug 29797) Error: "Tried to load block with invalid type" when subpages are disabled for user pages.
Patch by Jarry1250
Modified paths:
  • /trunk/phase3/CREDITS (modified) (history)
  • /trunk/phase3/RELEASE-NOTES-1.19 (modified) (history)
  • /trunk/phase3/includes/Block.php (modified) (history)

Diff [purge]

Index: trunk/phase3/RELEASE-NOTES-1.19
@@ -153,6 +153,8 @@
154154 * Translate the block expiry date
155155 * (bug 28630) Add iwlinks, langlinks, redirect to
156156 RefreshLinks::deleteLinksFromNonexistent
 157+* (bug 29797) Error: "Tried to load block with invalid type" when subpages
 158+ are disabled for user pages.
157159
158160 === API changes in 1.19 ===
159161 * BREAKING CHANGE: action=watch now requires POST and token.
Index: trunk/phase3/CREDITS
@@ -97,6 +97,7 @@
9898 * FunPika
9999 * Harry Burt
100100 * Ireas
 101+* Jarry1250
101102 * Jaska Zedlik
102103 * Jeremy Baron
103104 * Jidanni
Index: trunk/phase3/includes/Block.php
@@ -203,7 +203,8 @@
204204 $conds = array( 'ipb_address' => array() );
205205 }
206206
207 - # Be aware that the != '' check is explicit, since empty values will be passed by some callers.
 207+ # Be aware that the != '' check is explicit, since empty values will be
 208+ # passed by some callers (bug 29116)
208209 if( $vagueTarget != ''){
209210 list( $target, $type ) = self::parseTarget( $vagueTarget );
210211 switch( $type ) {
@@ -1039,6 +1040,14 @@
10401041 return array( null, null );
10411042 }
10421043
 1044+ # Consider the possibility that this is not a username at all
 1045+ # but actually an old subpage (bug #29797)
 1046+ if( strpos( $target, '/' ) !== false ){
 1047+ # An old subpage, drill down to the user behind it
 1048+ $parts = explode( '/', $target );
 1049+ $target = $parts[0];
 1050+ }
 1051+
10431052 $userObj = User::newFromName( $target );
10441053 if ( $userObj instanceof User ) {
10451054 # Note that since numbers are valid usernames, a $target of "12345" will be

Sign-offs

UserFlagDate
Nikerabbitinspected13:32, 20 July 2011

Follow-up revisions

RevisionCommit summaryAuthorDate
r91887Jarry1250 = Harry Burt, per Reedy on r91886robin17:01, 11 July 2011
r94350Fix r91886 thanks to johnduhart: check if it is an IP *before* stripping subp...robin14:32, 12 August 2011

Comments

#Comment by Reedy (talk | contribs)   16:56, 11 July 2011
===================================================================
--- trunk/phase3/CREDITS	(revision 91885)
+++ trunk/phase3/CREDITS	(revision 91886)
@@ -97,6 +97,7 @@
 * FunPika
 * Harry Burt
 * Ireas
+* Jarry1250
 * Jaska Zedlik
 * Jeremy Baron
 * Jidanni

Jarry1250 == Harry Burt

)
#Comment by SPQRobin (talk | contribs)   17:02, 11 July 2011

Ah, didn't know that, fixed in r91887

#Comment by Aaron Schulz (talk | contribs)   20:54, 2 August 2011

Slightly awkward, but OK.

Status & tagging log