r26337 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r26336‎ | r26337 | r26338 >
Date:00:48, 3 October 2007
Author:brion
Status:old
Tags:
Comment:
* (bug 11545) Don't let everything through if there's a bogus whitelist entry
Modified paths:
  • /trunk/extensions/SpamBlacklist/SpamBlacklist_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SpamBlacklist/SpamBlacklist_body.php
@@ -216,8 +216,12 @@
217217 " regexes: " . implode( ', ', $whitelists ) . "\n" );
218218 foreach( $whitelists as $regex ) {
219219 wfSuppressWarnings();
220 - $links = preg_replace( $regex, '', $links );
 220+ $newLinks = preg_replace( $regex, '', $links );
221221 wfRestoreWarnings();
 222+ if( is_string( $newLinks ) ) {
 223+ // If there wasn't a regex error, strip the matching URLs
 224+ $links = $newLinks;
 225+ }
222226 }
223227 }
224228

Status & tagging log