Merge "Always pass user to LogPage::addEntry"
[lhc/web/wiklou.git] / includes / revisiondelete / RevisionDeleteAbstracts.php
index 8b8a3a3..d822d09 100644 (file)
@@ -47,7 +47,7 @@ abstract class RevDel_List extends RevisionListBase {
         * Set the visibility for the revisions in this list. Logging and
         * transactions are done here.
         *
-        * @param $params array Associative array of parameters. Members are:
+        * @param array $params Associative array of parameters. Members are:
         *     value:       The integer value to set the visibility to
         *     comment:     The log comment.
         * @return Status
@@ -68,7 +68,7 @@ abstract class RevDel_List extends RevisionListBase {
 
                for ( $this->reset(); $this->current(); $this->next() ) {
                        $item = $this->current();
-                       unset( $missing[ $item->getId() ] );
+                       unset( $missing[$item->getId()] );
 
                        $oldBits = $item->getBits();
                        // Build the actual new rev_deleted bitfield
@@ -94,14 +94,14 @@ abstract class RevDel_List extends RevisionListBase {
                        }
                        if ( !$item->canView() ) {
                                // Cannot access this revision
-                               $msg = ($opType == 'show') ?
+                               $msg = ( $opType == 'show' ) ?
                                        'revdelete-show-no-access' : 'revdelete-modify-no-access';
                                $status->error( $msg, $item->formatDate(), $item->formatTime() );
                                $status->failCount++;
                                continue;
                        }
                        // Cannot just "hide from Sysops" without hiding any fields
-                       if( $newBits == Revision::DELETED_RESTRICTED ) {
+                       if ( $newBits == Revision::DELETED_RESTRICTED ) {
                                $status->warning( 'revdelete-only-restricted', $item->formatDate(), $item->formatTime() );
                                $status->failCount++;
                                continue;
@@ -113,9 +113,9 @@ abstract class RevDel_List extends RevisionListBase {
                        if ( $ok ) {
                                $idsForLog[] = $item->getId();
                                $status->successCount++;
-                               if( $item->getAuthorId() > 0 ) {
+                               if ( $item->getAuthorId() > 0 ) {
                                        $authorIds[] = $item->getAuthorId();
-                               } elseif( IP::isIPAddress( $item->getAuthorName() ) ) {
+                               } elseif ( IP::isIPAddress( $item->getAuthorName() ) ) {
                                        $authorIPs[] = $item->getAuthorName();
                                }
                        } else {
@@ -176,7 +176,7 @@ abstract class RevDel_List extends RevisionListBase {
 
        /**
         * Record a log entry on the action
-        * @param $params array Associative array of parameters:
+        * @param array $params Associative array of parameters:
         *     newBits:         The new value of the *_deleted bitfield
         *     oldBits:         The old value of the *_deleted bitfield.
         *     title:           The target title
@@ -189,7 +189,7 @@ abstract class RevDel_List extends RevisionListBase {
        protected function updateLog( $params ) {
                // Get the URL param's corresponding DB field
                $field = RevisionDeleter::getRelationType( $this->getType() );
-               if( !$field ) {
+               if ( !$field ) {
                        throw new MWException( "Bad log URL param type!" );
                }
                // Put things hidden from sysops in the oversight log
@@ -203,7 +203,7 @@ abstract class RevDel_List extends RevisionListBase {
                // Actually add the deletion log entry
                $log = new LogPage( $logType );
                $logid = $log->addEntry( $this->getLogAction(), $params['title'],
-                       $params['comment'], $logParams );
+                       $params['comment'], $logParams, $this->getUser() );
                // Allow for easy searching of deletion log items for revision/log items
                $log->addRelations( $field, $params['ids'], $logid );
                $log->addRelations( 'target_author_id', $params['authorIds'], $logid );
@@ -220,7 +220,7 @@ abstract class RevDel_List extends RevisionListBase {
 
        /**
         * Get log parameter array.
-        * @param $params array Associative array of log parameters, same as updateLog()
+        * @param array $params Associative array of log parameters, same as updateLog()
         * @return array
         */
        public function getLogParams( $params ) {