Index: trunk/phase3/includes/Revision.php |
— | — | @@ -110,9 +110,7 @@ |
111 | 111 | 'minor_edit' => $row->ar_minor_edit, |
112 | 112 | 'text_id' => isset( $row->ar_text_id ) ? $row->ar_text_id : null, |
113 | 113 | 'deleted' => $row->ar_deleted, |
114 | | - 'len' => $row->ar_len, |
115 | | - 'sha1' => $row->ar_sha1 |
116 | | - ); |
| 114 | + 'len' => $row->ar_len); |
117 | 115 | if ( isset( $row->ar_text ) && !$row->ar_text_id ) { |
118 | 116 | // Pre-1.5 ar_text row |
119 | 117 | $attribs['text'] = self::getRevisionText( $row, 'ar_' ); |
— | — | @@ -303,8 +301,7 @@ |
304 | 302 | 'rev_minor_edit', |
305 | 303 | 'rev_deleted', |
306 | 304 | 'rev_len', |
307 | | - 'rev_parent_id', |
308 | | - 'rev_sha1' |
| 305 | + 'rev_parent_id' |
309 | 306 | ); |
310 | 307 | } |
311 | 308 | |
— | — | @@ -360,12 +357,6 @@ |
361 | 358 | $this->mSize = intval( $row->rev_len ); |
362 | 359 | } |
363 | 360 | |
364 | | - if ( !isset( $row->rev_sha1 ) ) { |
365 | | - $this->mSha1 = null; |
366 | | - } else { |
367 | | - $this->mSha1 = $row->rev_sha1; |
368 | | - } |
369 | | - |
370 | 361 | if( isset( $row->page_latest ) ) { |
371 | 362 | $this->mCurrent = ( $row->rev_id == $row->page_latest ); |
372 | 363 | $this->mTitle = Title::newFromRow( $row ); |
— | — | @@ -384,7 +375,7 @@ |
385 | 376 | } |
386 | 377 | } elseif( is_array( $row ) ) { |
387 | 378 | // Build a new revision to be saved... |
388 | | - global $wgUser; // ugh |
| 379 | + global $wgUser; |
389 | 380 | |
390 | 381 | $this->mId = isset( $row['id'] ) ? intval( $row['id'] ) : null; |
391 | 382 | $this->mPage = isset( $row['page'] ) ? intval( $row['page'] ) : null; |
— | — | @@ -396,7 +387,6 @@ |
397 | 388 | $this->mDeleted = isset( $row['deleted'] ) ? intval( $row['deleted'] ) : 0; |
398 | 389 | $this->mSize = isset( $row['len'] ) ? intval( $row['len'] ) : null; |
399 | 390 | $this->mParentId = isset( $row['parent_id'] ) ? intval( $row['parent_id'] ) : null; |
400 | | - $this->mSha1 = isset( $row['sha1'] ) ? strval( $row['sha1'] ) : null; |
401 | 391 | |
402 | 392 | // Enforce spacing trimming on supplied text |
403 | 393 | $this->mComment = isset( $row['comment'] ) ? trim( strval( $row['comment'] ) ) : null; |
— | — | @@ -405,14 +395,9 @@ |
406 | 396 | |
407 | 397 | $this->mTitle = null; # Load on demand if needed |
408 | 398 | $this->mCurrent = false; |
409 | | - # If we still have no length, see it we have the text to figure it out |
410 | | - if ( !$this->mSize ) { |
411 | | - $this->mSize = is_null( $this->mText ) ? null : strlen( $this->mText ); |
412 | | - } |
413 | | - # Same for sha1 |
414 | | - if ( $this->mSha1 === null ) { |
415 | | - $this->mSha1 = is_null( $this->mText ) ? null : self::base36Sha1( $this->mText ); |
416 | | - } |
| 399 | + # If we still have no len_size, see it we have the text to figure it out |
| 400 | + if ( !$this->mSize ) |
| 401 | + $this->mSize = is_null( $this->mText ) ? null : strlen( $this->mText ); |
417 | 402 | } else { |
418 | 403 | throw new MWException( 'Revision constructor passed invalid row format.' ); |
419 | 404 | } |
— | — | @@ -456,15 +441,6 @@ |
457 | 442 | } |
458 | 443 | |
459 | 444 | /** |
460 | | - * Returns the base36 sha1 of the text in this revision, or null if unknown. |
461 | | - * |
462 | | - * @return String |
463 | | - */ |
464 | | - public function getSha1() { |
465 | | - return $this->mSha1; |
466 | | - } |
467 | | - |
468 | | - /** |
469 | 445 | * Returns the title of the page associated with this entry. |
470 | 446 | * |
471 | 447 | * @return Title |
— | — | @@ -923,12 +899,8 @@ |
924 | 900 | 'rev_timestamp' => $dbw->timestamp( $this->mTimestamp ), |
925 | 901 | 'rev_deleted' => $this->mDeleted, |
926 | 902 | 'rev_len' => $this->mSize, |
927 | | - 'rev_parent_id' => is_null( $this->mParentId ) |
928 | | - ? $this->getPreviousRevisionId( $dbw ) |
929 | | - : $this->mParentId, |
930 | | - 'rev_sha1' => is_null( $this->mSha1 ) |
931 | | - ? Revision::base36Sha1( $this->mText ) |
932 | | - : $this->mSha1 |
| 903 | + 'rev_parent_id' => is_null($this->mParentId) ? |
| 904 | + $this->getPreviousRevisionId( $dbw ) : $this->mParentId |
933 | 905 | ), __METHOD__ |
934 | 906 | ); |
935 | 907 | |
— | — | @@ -941,15 +913,6 @@ |
942 | 914 | } |
943 | 915 | |
944 | 916 | /** |
945 | | - * Get the base 36 SHA-1 value for a string of text |
946 | | - * @param $text String |
947 | | - * @return String |
948 | | - */ |
949 | | - public static function base36Sha1( $text ) { |
950 | | - return wfBaseConvert( sha1( $text ), 16, 36, 31 ); |
951 | | - } |
952 | | - |
953 | | - /** |
954 | 917 | * Lazy-load the revision's text. |
955 | 918 | * Currently hardcoded to the 'text' table storage engine. |
956 | 919 | * |
Index: trunk/phase3/includes/WikiPage.php |
— | — | @@ -1662,8 +1662,7 @@ |
1663 | 1663 | 'ar_flags' => '\'\'', // MySQL's "strict mode"... |
1664 | 1664 | 'ar_len' => 'rev_len', |
1665 | 1665 | 'ar_page_id' => 'page_id', |
1666 | | - 'ar_deleted' => $bitfield, |
1667 | | - 'ar_sha1' => 'rev_sha1' |
| 1666 | + 'ar_deleted' => $bitfield |
1668 | 1667 | ), array( |
1669 | 1668 | 'page_id' => $id, |
1670 | 1669 | 'page_id = rev_page' |
Index: trunk/phase3/includes/specials/SpecialUndelete.php |
— | — | @@ -124,7 +124,7 @@ |
125 | 125 | $res = $dbr->select( 'archive', |
126 | 126 | array( |
127 | 127 | 'ar_minor_edit', 'ar_timestamp', 'ar_user', 'ar_user_text', |
128 | | - 'ar_comment', 'ar_len', 'ar_deleted', 'ar_rev_id', 'ar_sha1' |
| 128 | + 'ar_comment', 'ar_len', 'ar_deleted', 'ar_rev_id' |
129 | 129 | ), |
130 | 130 | array( 'ar_namespace' => $this->title->getNamespace(), |
131 | 131 | 'ar_title' => $this->title->getDBkey() ), |
— | — | @@ -464,8 +464,7 @@ |
465 | 465 | 'ar_text_id', |
466 | 466 | 'ar_deleted', |
467 | 467 | 'ar_page_id', |
468 | | - 'ar_len', |
469 | | - 'ar_sha1' ), |
| 468 | + 'ar_len' ), |
470 | 469 | /* WHERE */ array( |
471 | 470 | 'ar_namespace' => $this->title->getNamespace(), |
472 | 471 | 'ar_title' => $this->title->getDBkey(), |