Siebrand has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/89819


Change subject: Ensure variables are defined
......................................................................

Ensure variables are defined

Change-Id: Iab1d36b0162c1d7a91cdd80ac36bbf338e7df61d
---
M AbuseFilter.class.php
M AbuseFilterVariableHolder.php
M Views/AbuseFilterViewDiff.php
M api/ApiAbuseFilterCheckMatch.php
4 files changed, 6 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AbuseFilter 
refs/changes/19/89819/1

diff --git a/AbuseFilter.class.php b/AbuseFilter.class.php
index 61939ce..a585c00 100644
--- a/AbuseFilter.class.php
+++ b/AbuseFilter.class.php
@@ -497,6 +497,8 @@
                if ( $profile ) {
                        $startConds = self::$condCount;
                        $startTime = microtime( true );
+               } else {
+                       $startConds = $startTime = null;
                }
 
                // Store the row somewhere convenient
diff --git a/AbuseFilterVariableHolder.php b/AbuseFilterVariableHolder.php
index c33da01..10699de 100644
--- a/AbuseFilterVariableHolder.php
+++ b/AbuseFilterVariableHolder.php
@@ -118,6 +118,7 @@
        public function dumpAllVars( $compute = array(), $includeUserVars = 
false ) {
                $allVarNames = array_keys( $this->mVars );
                $exported = array();
+               $coreVariables = array();
 
                if ( !$includeUserVars ) {
                        // Compile a list of all variables set by the extension 
to be able to filter user set ones by name
diff --git a/Views/AbuseFilterViewDiff.php b/Views/AbuseFilterViewDiff.php
index 3353f29..58ec329 100644
--- a/Views/AbuseFilterViewDiff.php
+++ b/Views/AbuseFilterViewDiff.php
@@ -147,6 +147,7 @@
                        return $cache[$spec];
 
                $dbr = wfGetDB( DB_SLAVE );
+               $row = null;
                if ( is_numeric( $spec ) ) {
                        $row = $dbr->selectRow(
                                'abuse_filter_history',
@@ -182,7 +183,6 @@
                                $this->getOutput()->redirect( $t->getFullURL() 
);
                                return null;
                        }
-
                } elseif ( $spec == 'next' && !in_array( $otherSpec, 
$dependentSpecs ) ) {
                        // cached
                        $other = $this->loadSpec( $otherSpec, $spec );
diff --git a/api/ApiAbuseFilterCheckMatch.php b/api/ApiAbuseFilterCheckMatch.php
index 5490cc9..c6e700a 100644
--- a/api/ApiAbuseFilterCheckMatch.php
+++ b/api/ApiAbuseFilterCheckMatch.php
@@ -43,6 +43,8 @@
                        }
 
                        $vars = AbuseFilter::loadVarDump( $row->afl_var_dump );
+               } else {
+                       $vars = null;
                }
 
                if ( AbuseFilter::checkSyntax( $params[ 'filter' ] ) !== true ) 
{

-- 
To view, visit https://gerrit.wikimedia.org/r/89819
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iab1d36b0162c1d7a91cdd80ac36bbf338e7df61d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AbuseFilter
Gerrit-Branch: master
Gerrit-Owner: Siebrand <siebr...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to