Index: trunk/extensions/SpamBlacklist/SpamBlacklist_body.php |
— | — | @@ -216,8 +216,12 @@ |
217 | 217 | " regexes: " . implode( ', ', $whitelists ) . "\n" ); |
218 | 218 | foreach( $whitelists as $regex ) { |
219 | 219 | wfSuppressWarnings(); |
220 | | - $links = preg_replace( $regex, '', $links ); |
| 220 | + $newLinks = preg_replace( $regex, '', $links ); |
221 | 221 | wfRestoreWarnings(); |
| 222 | + if( is_string( $newLinks ) ) { |
| 223 | + // If there wasn't a regex error, strip the matching URLs |
| 224 | + $links = $newLinks; |
| 225 | + } |
222 | 226 | } |
223 | 227 | } |
224 | 228 | |