Revision: 48551
Author:   werdna
Date:     2009-03-19 00:07:29 +0000 (Thu, 19 Mar 2009)

Log Message:
-----------
Some fixes for r48545

Modified Paths:
--------------
    trunk/extensions/AbuseFilter/AbuseFilter.parser.php

Modified: trunk/extensions/AbuseFilter/AbuseFilter.parser.php
===================================================================
--- trunk/extensions/AbuseFilter/AbuseFilter.parser.php 2009-03-18 23:59:38 UTC 
(rev 48550)
+++ trunk/extensions/AbuseFilter/AbuseFilter.parser.php 2009-03-19 00:07:29 UTC 
(rev 48551)
@@ -387,8 +387,6 @@
        }
        
        function intEval( $code ) {
-               wfProfileIn( __METHOD__ );
-               
                // Setup, resetting
                $this->mCode = $code;
                $this->mPos = 0;
@@ -399,7 +397,6 @@
                
                $result = new AFPData();
                $this->doLevelEntry( $result );
-               wfProfileOut( __METHOD__ );
                return $result;
        }
        
@@ -521,23 +518,23 @@
                        $this->move();
                        $r2 = new AFPData();
                        
-                       if ($op == '&' && !$result) {
+                       if ($op == '&' && !($result->toBool())) {
                                wfProfileIn( __METHOD__.'-shortcircuit' );
                                $orig = $this->mShortCircuit;
                                $this->mShortCircuit = true;
                                $this->doLevelCompares( $r2 );
-                               $this->mShortCircuit = false;
+                               $this->mShortCircuit = $orig;
                                $result = new AFPData( AFPData::DBool, false );
                                wfProfileOut( __METHOD__.'-shortcircuit' );
                                return;
                        }
                        
-                       if ($op == '|' && $result) {
+                       if ($op == '|' && ($result->toBool())) {
                                wfProfileIn( __METHOD__.'-shortcircuit' );
                                $orig = $this->mShortCircuit;
                                $this->mShortCircuit = true;
                                $this->doLevelCompares( $r2 );
-                               $this->mShortCircuit = false;
+                               $this->mShortCircuit = $orig;
                                $result = new AFPData( AFPData::DBool, true );
                                wfProfileOut( __METHOD__.'-shortcircuit' );
                                return;
@@ -636,6 +633,7 @@
                        }
                        
                        wfProfileIn( __METHOD__ );
+                       
                        wfProfileIn( __METHOD__."-$func" );
                        $result = AFPData::$func( $result, $r2 );
                        wfProfileOut( __METHOD__."-$func" );
@@ -694,6 +692,7 @@
                        wfProfileOut( __METHOD__."-loadargs" );
                        
                        if ($this->mShortCircuit) {
+                               wfProfileOut( __METHOD__ );
                                return; // The result doesn't matter.
                        }
                        
@@ -777,7 +776,7 @@
                                                                                
                array( $var ) );
                } else {
                        $val = $this->mVars->getVar( $var );
-                       wfProfile( __METHOD__ );
+                       wfProfileOut( __METHOD__ );
                        return $val;
                }
        }



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to