Merge "Add hook to allow extensions to modify the LonelyPages query"
[lhc/web/wiklou.git] / includes / utils / ZipDirectoryReader.php
index 7bf538a..1419bbb 100644 (file)
@@ -93,27 +93,27 @@ class ZipDirectoryReader {
        }
 
        /** The file name */
-       var $fileName;
+       protected $fileName;
 
        /** The opened file resource */
-       var $file;
+       protected $file;
 
        /** The cached length of the file, or null if it has not been loaded yet. */
-       var $fileLength;
+       protected $fileLength;
 
        /** A segmented cache of the file contents */
-       var $buffer;
+       protected $buffer;
 
        /** The file data callback */
-       var $callback;
+       protected $callback;
 
        /** The ZIP64 mode */
-       var $zip64 = false;
+       protected $zip64 = false;
 
        /** Stored headers */
-       var $eocdr, $eocdr64, $eocdr64Locator;
+       protected $eocdr, $eocdr64, $eocdr64Locator;
 
-       var $data;
+       protected $data;
 
        /** The "extra field" ID for ZIP64 central directory entries */
        const ZIP64_EXTRA_HEADER = 0x0001;
@@ -247,8 +247,8 @@ class ZipDirectoryReader {
                );
                $structSize = $this->getStructSize( $info );
 
-               $block = $this->getBlock( $this->getFileLength() - $this->eocdr['EOCDR size']
-                       - $structSize, $structSize );
+               $start = $this->getFileLength() - $this->eocdr['EOCDR size'] - $structSize;
+               $block = $this->getBlock( $start, $structSize );
                $this->eocdr64Locator = $data = $this->unpack( $block, $info );
 
                if ( $data['signature'] !== "PK\x06\x07" ) {
@@ -704,7 +704,7 @@ class ZipDirectoryReader {
  * Internal exception class. Will be caught by private code.
  */
 class ZipDirectoryReaderError extends Exception {
-       var $errorCode;
+       protected $errorCode;
 
        function __construct( $code ) {
                $this->errorCode = $code;