(bug 43096) Fix querying suppression logs
authorAlex Monk <krenair@gmail.com>
Sun, 16 Dec 2012 13:28:50 +0000 (13:28 +0000)
committerAlex Monk <krenair@gmail.com>
Mon, 17 Dec 2012 19:58:41 +0000 (19:58 +0000)
Change-Id: Ia9709ed5f694e07b7544887b49c99db5ed7063df

includes/api/ApiQueryLogEvents.php

index e51b558..1b65168 100644 (file)
@@ -58,7 +58,7 @@ class ApiQueryLogEvents extends ApiQueryBase {
                $this->fld_details = isset( $prop['details'] );
                $this->fld_tags = isset( $prop['tags'] );
 
-               $hideLogs = LogEventsList::getExcludeClause( $db );
+               $hideLogs = LogEventsList::getExcludeClause( $db, 'user' );
                if ( $hideLogs !== false ) {
                        $this->addWhere( $hideLogs );
                }
@@ -367,8 +367,10 @@ class ApiQueryLogEvents extends ApiQueryBase {
                if ( !is_null( $params['prop'] ) && in_array( 'parsedcomment', $params['prop'] ) ) {
                        // formatComment() calls wfMessage() among other things
                        return 'anon-public-user-private';
-               } else {
+               } elseif ( LogEventsList::getExcludeClause( $this->getDB(), 'user' ) === LogEventsList::getExcludeClause( $this->getDB(), 'public' ) ) { // Output can only contain public data.
                        return 'public';
+               } else {
+                       return 'anon-public-user-private';
                }
        }