(bug 18165) Keep the same parser object between filter runs

This commit is contained in:
Andrew Garrett 2009-03-26 04:09:07 +00:00
parent c597c1915f
commit 3458bf1a7a

View file

@ -339,12 +339,17 @@ class AbuseFilter {
public static function checkConditions( $conds, $vars, $ignoreError = true ) {
global $wgAbuseFilterParserClass;
static $parser;
wfProfileIn( __METHOD__ );
try {
if ( is_null($parser) ) {
$parser = new $wgAbuseFilterParserClass;
$parser->setVars( $vars );
}
try {
$result = $parser->parse( $conds, self::$condCount );
} catch (Exception $excep) {
// Sigh.