safer check if mhash is available (and I'm about to make it unavailable by disabling...
authorAriel Glenn <ariel@users.mediawiki.org>
Sun, 12 Jun 2011 12:02:53 +0000 (12:02 +0000)
committerAriel Glenn <ariel@users.mediawiki.org>
Sun, 12 Jun 2011 12:02:53 +0000 (12:02 +0000)
includes/HistoryBlob.php

index f707b3f..7535a0d 100644 (file)
@@ -516,7 +516,7 @@ class DiffHistoryBlob implements HistoryBlob {
                $header = unpack( 'Vofp/Vcsize', substr( $diff, 0, 8 ) );
                
                # Check the checksum if mhash is available
-               if ( extension_loaded( 'mhash' ) ) {
+               if ( function_exists( 'mhash' ) ) {
                        $ofp = mhash( MHASH_ADLER32, $base );
                        if ( $ofp !== substr( $diff, 0, 4 ) ) {
                                wfDebug( __METHOD__. ": incorrect base checksum\n" );