Index: trunk/phase3/includes/specials/SpecialRevisiondelete.php |
— | — | @@ -85,6 +85,7 @@ |
86 | 86 | $this->showImages(); |
87 | 87 | } else if( $this->deleteKey == 'logid' ) { |
88 | 88 | $this->showLogItems(); |
| 89 | + return; // no logs for now |
89 | 90 | } |
90 | 91 | list($qc,$lim) = $this->getLogQueryCond(); |
91 | 92 | # Show relevant lines from the deletion log |
— | — | @@ -121,8 +122,8 @@ |
122 | 123 | |
123 | 124 | private function getLogQueryCond() { |
124 | 125 | $ids = $safeIds = array(); |
125 | | - $action = 'revision'; |
126 | 126 | $limit = 25; // default |
| 127 | + $conds = array( 'log_action' => 'revision' ); // revision delete logs |
127 | 128 | switch( $this->deleteKey ) { |
128 | 129 | case 'oldid': |
129 | 130 | $ids = $this->oldids; |
— | — | @@ -136,13 +137,10 @@ |
137 | 138 | case 'fileid': |
138 | 139 | $ids = $this->fileids; |
139 | 140 | break; |
140 | | - case 'logid': |
| 141 | + default: // bad type? |
141 | 142 | $ids = $this->logids; |
142 | | - $action = 'event'; |
143 | | - break; |
| 143 | + return array($conds,$limit); |
144 | 144 | } |
145 | | - // Revision delete logs |
146 | | - $conds = array( 'log_action' => $action ); |
147 | 145 | // Just get the whole log if there are a lot if items |
148 | 146 | if( count($ids) > $limit ) |
149 | 147 | return array($conds,$limit); |
— | — | @@ -152,22 +150,9 @@ |
153 | 151 | $safeIds[] = $m[0]; |
154 | 152 | } |
155 | 153 | } |
156 | | - // Optimization for logs: the event was hidden after it was made |
157 | | - if( $action == 'event' ) { |
158 | | - $dbr = wfGetDB( DB_SLAVE ); |
159 | | - # Get the timestamp of the first item |
160 | | - $first = $dbr->selectField( 'logging', 'log_timestamp', |
161 | | - array('log_id' => $safeIds), __METHOD__, array('ORDER BY' => 'log_id') ); |
162 | | - if( $first == false ) { |
163 | | - return array( array('1=0'), $limit ); // If there are no items, then stop here |
164 | | - } |
165 | | - $conds[] = 'log_timestamp > '.$dbr->addQuotes($first); // type,time index |
166 | | - } |
167 | 154 | // Format is <id1,id2,i3...> |
168 | 155 | if( count($safeIds) ) { |
169 | | - // Log deletions do not have an item type, others do... |
170 | | - $type = ($this->deleteKey != 'logid') ? "^{$this->deleteKey}.*" : ''; |
171 | | - $conds[] = "log_params RLIKE '$type(^|\n|,)(".implode('|',$safeIds).")(,|\n|$)'"; |
| 156 | + $conds[] = "log_params RLIKE '^{$this->deleteKey}.*(^|\n|,)(".implode('|',$safeIds).")(,|\n|$)'"; |
172 | 157 | } else { |
173 | 158 | $conds = array('1=0'); |
174 | 159 | } |