X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FHistoryBlob.php;h=f707b3f6a5d6cb2855143950ac174e611d0f9d3e;hb=957850f0da357337c24291a29d5ea0f08b5050a9;hp=3fc27a29449f9acbf81476b5a4e4137b484d03d1;hpb=3614ecfffb7dc7251951e00c02d20ab4275fd5bd;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/HistoryBlob.php b/includes/HistoryBlob.php index 3fc27a2944..f707b3f6a5 100644 --- a/includes/HistoryBlob.php +++ b/includes/HistoryBlob.php @@ -225,8 +225,8 @@ class HistoryBlobStub { $flags = explode( ',', $row->old_flags ); if( in_array( 'external', $flags ) ) { $url=$row->old_text; - @list( /* $proto */ ,$path)=explode('://',$url,2); - if ( $path == "" ) { + $parts = explode( '://', $url, 2 ); + if ( !isset( $parts[1] ) || $parts[1] == '' ) { wfProfileOut( $fname ); return false; } @@ -290,6 +290,8 @@ class HistoryBlobCurStub { /** * Sets the location (cur_id) of the main object to which this object * points + * + * @param $id int */ function setLocation( $id ) { $this->mCurId = $id; @@ -482,6 +484,11 @@ class DiffHistoryBlob implements HistoryBlob { } } + /** + * @param $t1 + * @param $t2 + * @return string + */ function diff( $t1, $t2 ) { # Need to do a null concatenation with warnings off, due to bugs in the current version of xdiff # "String is not zero-terminated" @@ -491,6 +498,11 @@ class DiffHistoryBlob implements HistoryBlob { return $diff; } + /** + * @param $base + * @param $diff + * @return bool|string + */ function patch( $base, $diff ) { if ( function_exists( 'xdiff_string_bpatch' ) ) { wfSuppressWarnings(); @@ -561,6 +573,9 @@ class DiffHistoryBlob implements HistoryBlob { } } + /** + * @return array + */ function __sleep() { $this->compress(); if ( !count( $this->mItems ) ) { @@ -626,6 +641,8 @@ class DiffHistoryBlob implements HistoryBlob { /** * Helper function for compression jobs * Returns true until the object is "full" and ready to be committed + * + * @return bool */ function isHappy() { return $this->mSize < $this->mMaxSize