r26506 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r26505‎ | r26506 | r26507 >
Date:16:00, 8 October 2007
Author:aaron
Status:old
Tags:
Comment:
*Disallow url floods
Modified paths:
  • /trunk/extensions/ConfirmAccount/ConfirmAccount_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ConfirmAccount/ConfirmAccount_body.php
@@ -608,6 +608,9 @@
609609 */
610610 function parseLinks( $text ) {
611611 global $wgParser, $wgTitle, $wgUser;
 612+ # Don't let this get flooded
 613+ $max = 10;
 614+ $count = 0;
612615
613616 $linkList = '';
614617 $lines = explode( "\n", htmlspecialchars($text) );
@@ -616,6 +619,9 @@
617620 $link = $links[0];
618621 if( strpos($link,'.') )
619622 $linkList .= "<li><a href='$link'>$link</a></li>\n";
 623+ $count++;
 624+ if( $count >= $max )
 625+ break;
620626 }
621627 if( $linkList == '' ) {
622628 $linkList = wfMsgHtml( 'confirmaccount-nourls' );

Status & tagging log