r111706 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111705‎ | r111706 | r111707 >
Date:00:28, 17 February 2012
Author:tstarling
Status:ok
Tags:
Comment:
Clarified comment per CR r111701
Modified paths:
  • /trunk/phase3/includes/HistoryBlob.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/HistoryBlob.php
@@ -567,10 +567,11 @@
568568 function xdiffAdler32( $s ) {
569569 static $init;
570570 if ( $init === null ) {
571 - // The real Adler-32 checksum of this string is zero, so it
572 - // initialises the state to the LibXDiff initial value.
573571 $init = str_repeat( "\xf0", 205 ) . "\xee" . str_repeat( "\xf0", 67 ) . "\x02";
574572 }
 573+ // The real Adler-32 checksum of $init is zero, so it initialises the
 574+ // state to zero, as it is at the start of LibXDiff's checksum
 575+ // algorithm. Appending the subject string then simulates LibXDiff.
575576 if ( function_exists( 'hash' ) ) {
576577 $hash = hash( 'adler32', $init . $s, true );
577578 } elseif ( function_exists( 'mhash' ) ) {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r111701(bug 34428) Fixed hash mismatch errors in DiffHistoryBlob::patch() by simulat...tstarling23:27, 16 February 2012

Status & tagging log