X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryLogEvents.php;h=3cdc53caf2bdd3c526799e84f30874ee4359d387;hb=4d1d9f65021c60eccb1295a13565d8d7fd926966;hp=5f9fae48b7df78a5df4dbb7e48399a9d0bb5deb4;hpb=e4b551ca0e4d36b45ef6319301fa962450cc5b17;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryLogEvents.php b/includes/api/ApiQueryLogEvents.php index 5f9fae48b7..3cdc53caf2 100644 --- a/includes/api/ApiQueryLogEvents.php +++ b/includes/api/ApiQueryLogEvents.php @@ -36,7 +36,7 @@ class ApiQueryLogEvents extends ApiQueryBase { } private $fld_ids = false, $fld_title = false, $fld_type = false, - $fld_action = false, $fld_user = false, $fld_userid = false, + $fld_user = false, $fld_userid = false, $fld_timestamp = false, $fld_comment = false, $fld_parsedcomment = false, $fld_details = false, $fld_tags = false; @@ -50,7 +50,6 @@ class ApiQueryLogEvents extends ApiQueryBase { $this->fld_ids = isset( $prop['ids'] ); $this->fld_title = isset( $prop['title'] ); $this->fld_type = isset( $prop['type'] ); - $this->fld_action = isset( $prop['action'] ); $this->fld_user = isset( $prop['user'] ); $this->fld_userid = isset( $prop['userid'] ); $this->fld_timestamp = isset( $prop['timestamp'] ); @@ -200,8 +199,7 @@ class ApiQueryLogEvents extends ApiQueryBase { } // Paranoia: avoid brute force searches (bug 17342) - $hideActions = $params['namespace'] !== null || !is_null( $title ) || !is_null( $params['action'] ); - if ( $hideActions || !is_null( $user ) ) { + if ( $params['namespace'] !== null || !is_null( $title ) || !is_null( $user ) ) { if ( !$this->getUser()->isAllowed( 'deletedhistory' ) ) { $titleBits = LogPage::DELETED_ACTION; $userBits = LogPage::DELETED_USER; @@ -212,7 +210,7 @@ class ApiQueryLogEvents extends ApiQueryBase { $titleBits = 0; $userBits = 0; } - if ( $hideActions && $titleBits ) { + if ( ( $params['namespace'] !== null || !is_null( $title ) ) && $titleBits ) { $this->addWhere( $db->bitAnd( 'log_deleted', $titleBits ) . " != $titleBits" ); } if ( !is_null( $user ) && $userBits ) { @@ -313,7 +311,8 @@ class ApiQueryLogEvents extends ApiQueryBase { break; } $vals2 = array(); - list( $vals2['duration'], $vals2['flags'] ) = $params; + $vals2['duration'] = $params[0]; + $vals2['flags'] = isset( $params[1] ) ? $params[1] : ''; // Indefinite blocks have no expiry time if ( SpecialBlock::parseExpiryInput( $params[0] ) !== wfGetDB( DB_SLAVE )->getInfinity() ) { @@ -373,18 +372,12 @@ class ApiQueryLogEvents extends ApiQueryBase { $title = Title::makeTitle( $row->log_namespace, $row->log_title ); } - if ( $this->fld_title || $this->fld_ids || $this->fld_type - || $this->fld_details && $row->log_params !== '' - ) { + if ( $this->fld_title || $this->fld_ids || $this->fld_details && $row->log_params !== '' ) { if ( LogEventsList::isDeleted( $row, LogPage::DELETED_ACTION ) ) { $vals['actionhidden'] = ''; $anyHidden = true; } if ( LogEventsList::userCan( $row, LogPage::DELETED_ACTION, $user ) ) { - - if ( $this->fld_type ) { - $vals['action'] = $row->log_action; - } if ( $this->fld_title ) { ApiQueryBase::addTitleInfo( $vals, $title ); } @@ -408,6 +401,7 @@ class ApiQueryLogEvents extends ApiQueryBase { if ( $this->fld_type ) { $vals['type'] = $row->log_type; + $vals['action'] = $row->log_action; } if ( $this->fld_user || $this->fld_userid ) {