diff --git a/composer.json b/composer.json index e46d38103a604..b473147ef3256 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ "require": { "php": ">=5.3.10", "joomla/application": "~1.9", - "joomla/archive": "^1.1.7", + "joomla/archive": "dev-master", "joomla/data": "~1.2", "joomla/di": "~1.5", "joomla/event": "~1.2", diff --git a/libraries/joomla/archive/zip.php b/libraries/joomla/archive/zip.php index 613a48509cc36..6c82240bda58e 100644 --- a/libraries/joomla/archive/zip.php +++ b/libraries/joomla/archive/zip.php @@ -305,16 +305,13 @@ protected function extractNative($archive, $destination) continue; } - $stream = $zip->getStream($file); + $buffer = $zip->getFromIndex($index); - if ($stream === false) + if ($buffer === false) { return $this->raiseWarning(100, 'Unable to read entry'); } - $buffer = stream_get_contents($stream); - fclose($stream); - if (JFile::write($destination . '/' . $file, $buffer) === false) { return $this->raiseWarning(100, 'Unable to write entry'); diff --git a/libraries/vendor/joomla/archive/src/Zip.php b/libraries/vendor/joomla/archive/src/Zip.php index 785e14428abcf..6e79ce34a9099 100644 --- a/libraries/vendor/joomla/archive/src/Zip.php +++ b/libraries/vendor/joomla/archive/src/Zip.php @@ -270,8 +270,8 @@ protected function extractCustom($archive, $destination) * * @return boolean True on success * - * @since 1.0 * @throws \RuntimeException + * @since 1.0 */ protected function extractNative($archive, $destination) { @@ -285,7 +285,7 @@ protected function extractNative($archive, $destination) // Make sure the destination folder exists if (!Folder::create($destination)) { - throw new \RuntimeException('Unable to create destination folder ' . \dirname($path)); + throw new \RuntimeException('Unable to create destination folder ' . \dirname($destination)); } // Read files in the archive @@ -298,16 +298,13 @@ protected function extractNative($archive, $destination) continue; } - $stream = $zip->getStream($file); + $buffer = $zip->getFromIndex($index); - if ($stream === false) + if ($buffer === false) { throw new \RuntimeException('Unable to read ZIP entry'); } - $buffer = stream_get_contents($stream); - fclose($stream); - if (File::write($destination . '/' . $file, $buffer) === false) { throw new \RuntimeException('Unable to write ZIP entry to file ' . $destination . '/' . $file);