mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-12 00:38:23 +00:00
Avoid DEMPTY leak
As shown in the coverage reports [0], some empty operand logging lines are covered, but no test should have empty operands. I see one of the cause is skipOverBraces keeping $result as is, even if DEMPTY, so turn it into a DUNDEFINED. [0] - https://doc.wikimedia.org/cover-extensions/AbuseFilter/includes/parser/AbuseFilterParser.php.html Change-Id: I7831f3ed9f7c0656e0e8f77ded049c20eca682ba
This commit is contained in:
parent
879ff59fe2
commit
f977e858ab
|
@ -791,6 +791,7 @@ class AbuseFilterParser {
|
|||
protected function doLevelBraces( &$result ) {
|
||||
if ( $this->mCur->type === AFPToken::TBRACE && $this->mCur->value === '(' ) {
|
||||
if ( $this->mShortCircuit ) {
|
||||
$result = new AFPData( AFPData::DEMPTY );
|
||||
$this->skipOverBraces();
|
||||
} else {
|
||||
$this->doLevelSemicolon( $result );
|
||||
|
@ -830,6 +831,7 @@ class AbuseFilterParser {
|
|||
}
|
||||
|
||||
if ( $this->mShortCircuit ) {
|
||||
$result = new AFPData( AFPData::DEMPTY );
|
||||
$this->skipOverBraces();
|
||||
$this->move();
|
||||
|
||||
|
|
Loading…
Reference in a new issue