Skip to content

Instantly share code, notes, and snippets.

@polymorphm
Created September 30, 2011 11:43
Show Gist options
  • Save polymorphm/1253520 to your computer and use it in GitHub Desktop.
Save polymorphm/1253520 to your computer and use it in GitHub Desktop.
From dc066037384e93958a36d275b065a3d0c3938896 Mon Sep 17 00:00:00 2001
From: Andrej A Antonov <polymorphm@gmail.com>
Date: Fri, 30 Sep 2011 15:31:04 +0400
Subject: [PATCH] fixed zip_open() fail actions
---
libraries/joomla/filesystem/archive/zip.php | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/libraries/joomla/filesystem/archive/zip.php b/libraries/joomla/filesystem/archive/zip.php
index 9b6da18..9686794 100644
--- a/libraries/joomla/filesystem/archive/zip.php
+++ b/libraries/joomla/filesystem/archive/zip.php
@@ -254,10 +254,8 @@ class JArchiveZip extends JObject
*/
protected function _extractNative($archive, $destination, $options)
{
- if ($zip = zip_open($archive))
+ if (($zip = zip_open($archive)) && is_resource($zip))
{
- if (is_resource($zip))
- {
// Make sure the destination folder exists
if (!JFolder::create($destination))
{
@@ -292,7 +290,6 @@ class JArchiveZip extends JObject
}
@zip_close($zip);
- }
}
else
{
--
1.7.4.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment