r53177 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r53176‎ | r53177 | r53178 >
Date:16:06, 13 July 2009
Author:werdna
Status:deferred
Tags:
Comment:
Fix a fatal by not validating usernames when grabbing a thread author. This seems to reject things like IPv6 addresses.
Modified paths:
  • /trunk/extensions/LiquidThreads/classes/LqtDispatch.php (modified) (history)
  • /trunk/extensions/LiquidThreads/classes/LqtThread.php (modified) (history)
  • /trunk/extensions/LiquidThreads/pages/TalkpageView.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LiquidThreads/pages/TalkpageView.php
@@ -103,7 +103,7 @@
104104 $row .= Xml::tags( 'td', null, $subject );
105105
106106 $author = $thread->author();
107 - $authorLink = $sk->userLink( $author->getID(), $author->getName() );
 107+ $authorLink = $sk->userLink( $author->getId(), $author->getName() );
108108 $row .= Xml::tags( 'td', null, $authorLink );
109109
110110 $row .= Xml::element( 'td', null, count( $thread->replies() ) );
Index: trunk/extensions/LiquidThreads/classes/LqtDispatch.php
@@ -207,15 +207,16 @@
208208 $s = preg_replace( '/\<\/li\>$/', $appendix . '</li>', $s ); // TODO ew
209209 }
210210 else {
 211+ global $wgOut;
 212+
211213 $sig = "";
212214 $changeslist->insertUserRelatedLinks( $sig, $rc );
213215
214216 // This should be stored in RC.
215217 $quote = Revision::newFromId( $rc->mAttribs['rc_this_oldid'] )->getText();
216218 if ( strlen( $quote ) > 230 ) {
217 - global $wgOut;
218219 $sk = $changeslist->skin;
219 - substr( $quote, 0, 200 ) .
 220+ $quote = substr( $quote, 0, 200 ) .
220221 $sk->link( $thread->title(), wfMsg( 'lqt_rc_ellipsis' ),
221222 array( 'class' => 'lqt_rc_ellipsis' ), array(), array( 'known' ) );
222223 }
Index: trunk/extensions/LiquidThreads/classes/LqtThread.php
@@ -190,9 +190,8 @@
191191 if ($this->authorId) {
192192 return User::newFromId( $this->authorId );
193193 } else {
194 - $u = User::newFromName( $this->authorName );
195 -
196 - return $u;
 194+ // Do NOT validate username. If the user did it, they did it.
 195+ return User::newFromName( $this->authorName, false );
197196 }
198197 }
199198

Status & tagging log