summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/zip/zip.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/ext/zip/zip.c b/ext/zip/zip.c
index 506552207c..27f72bb224 100644
--- a/ext/zip/zip.c
+++ b/ext/zip/zip.c
@@ -128,9 +128,18 @@ PHP_FUNCTION(zip_open)
return;
}
+ if (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_ALLOW_FILE_NOT_EXISTS))) {
+ RETURN_FALSE;
+ }
+
+ if (php_check_open_basedir(filename TSRMLS_CC)) {
+ RETURN_FALSE;
+ }
+
archive_p = zzip_opendir(filename);
if (archive_p == NULL) {
- php_error(E_WARNING, "Cannot open zip archive %s", filename);
+ php_error(E_WARNING, "%s() Cannot open zip archive %s",
+ get_active_function_name(TSRMLS_C), filename);
RETURN_FALSE;
}