From: Greg Beaver Date: Sun, 23 Mar 2008 06:59:59 +0000 (+0000) Subject: don't disallow opening .tar/.zip files as Phar object if readonly is disabled, the... X-Git-Tag: RELEASE_2_0_0a1~29 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=27ca45f898999b1b54f568ccc4c327e13ea07296;p=php don't disallow opening .tar/.zip files as Phar object if readonly is disabled, the whole idea is to be able to add crap including an automatic stub or explicit stub --- diff --git a/ext/phar/phar.c b/ext/phar/phar.c index 3fd7278b89..e6c1fca573 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -423,7 +423,7 @@ int phar_open_loaded(char *fname, int fname_len, char *alias, int alias_len, int if (!is_data) { /* prevent any ".phar" without a stub getting through */ if (!phar->halt_offset && !phar->is_brandnew) { - if (FAILURE == zend_hash_find(&(phar->manifest), ".phar/stub.php", sizeof(".phar/stub.php")-1, (void **)&stub)) { + if (PHAR_G(readonly) && FAILURE == zend_hash_find(&(phar->manifest), ".phar/stub.php", sizeof(".phar/stub.php")-1, (void **)&stub)) { spprintf(error, 0, "'%s' is not a phar archive. Use PharData::__construct() for a standard zip or tar archive", fname); return FAILURE; }