r47709 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r47708‎ | r47709 | r47710 >
Date:16:48, 23 February 2009
Author:ialex
Status:resolved (Comments)
Tags:
Comment:
Tweaks for Special:RevisonDelete:
* Use $db(r|w)->timestamp() for ar_timestamp, so that it can work properly with PostgreSQL, and decode it after
* Fixed double escaping for oi_archive_name
Modified paths:
  • /trunk/phase3/includes/specials/SpecialRevisiondelete.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialRevisiondelete.php
@@ -218,7 +218,7 @@
219219 } else {
220220 // Run through and pull all our data in one query
221221 foreach( $this->archrevs as $timestamp ) {
222 - $where[] = $timestamp;
 222+ $where[] = $dbr->timestamp( $timestamp );
223223 }
224224 $result = $dbr->select( 'archive', '*',
225225 array(
@@ -227,14 +227,15 @@
228228 'ar_timestamp' => $where ),
229229 __METHOD__ );
230230 while( $row = $dbr->fetchObject( $result ) ) {
231 - $revObjs[$row->ar_timestamp] = new Revision( array(
 231+ $timestamp = wfTimestamp( TS_MW, $timestamp );
 232+ $revObjs[$timestamp] = new Revision( array(
232233 'page' => $this->page->getArticleId(),
233234 'id' => $row->ar_rev_id,
234235 'text' => $row->ar_text_id,
235236 'comment' => $row->ar_comment,
236237 'user' => $row->ar_user,
237238 'user_text' => $row->ar_user_text,
238 - 'timestamp' => $row->ar_timestamp,
 239+ 'timestamp' => $timestamp,
239240 'minor_edit' => $row->ar_minor_edit,
240241 'text_id' => $row->ar_text_id,
241242 'deleted' => $row->ar_deleted,
@@ -333,7 +334,7 @@
334335 if( $this->deleteKey=='oldimage' ) {
335336 // Run through and pull all our data in one query
336337 foreach( $this->ofiles as $timestamp ) {
337 - $where[] = $dbr->addQuotes( $timestamp.'!'.$this->page->getDBKey() );
 338+ $where[] = $timestamp.'!'.$this->page->getDBKey();
338339 }
339340 $result = $dbr->select( 'oldimage', '*',
340341 array(
@@ -880,7 +881,7 @@
881882 $Id_set = array();
882883 // Run through and pull all our data in one query
883884 foreach( $items as $timestamp ) {
884 - $where[] = $timestamp;
 885+ $where[] = $this->dbw->timestamp( $timestamp );
885886 }
886887 $result = $this->dbw->select( 'archive', '*',
887888 array(
@@ -889,14 +890,15 @@
890891 'ar_timestamp' => $where ),
891892 __METHOD__ );
892893 while( $row = $this->dbw->fetchObject( $result ) ) {
893 - $revObjs[$row->ar_timestamp] = new Revision( array(
 894+ $timestamp = wfTimestamp( TS_MW, $row->ar_timestamp );
 895+ $revObjs[$timestamp] = new Revision( array(
894896 'page' => $title->getArticleId(),
895897 'id' => $row->ar_rev_id,
896898 'text' => $row->ar_text_id,
897899 'comment' => $row->ar_comment,
898900 'user' => $row->ar_user,
899901 'user_text' => $row->ar_user_text,
900 - 'timestamp' => $row->ar_timestamp,
 902+ 'timestamp' => $timestamp,
901903 'minor_edit' => $row->ar_minor_edit,
902904 'text_id' => $row->ar_text_id,
903905 'deleted' => $row->ar_deleted,
@@ -950,7 +952,7 @@
951953 $set = array();
952954 // Run through and pull all our data in one query
953955 foreach( $items as $timestamp ) {
954 - $where[] = $this->dbw->addQuotes( $timestamp.'!'.$title->getDBKey() );
 956+ $where[] = $timestamp.'!'.$title->getDBKey();
955957 }
956958 $result = $this->dbw->select( 'oldimage', '*',
957959 array(

Follow-up revisions

RevisionCommit summaryAuthorDate
r47730Fix timestamp bug from r47709aaron23:05, 23 February 2009
r47742Correct fix for r47709: the second parameter to wfTimestamp() was supposed to...ialex11:52, 24 February 2009

Comments

#Comment by Aaron Schulz (talk | contribs)   23:05, 23 February 2009

Fixed in r47730

Status & tagging log