mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-09-24 02:38:16 +00:00
(bug 18165) Keep the same parser object between filter runs
This commit is contained in:
parent
c597c1915f
commit
3458bf1a7a
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue