sfox            Tue May 13 18:43:18 2008 UTC

  Modified files:              
    /php-src/ext/phar   phar.c 
    /php-src/ext/phar/tests     phar_dotted_path.phpt 
  Log:
  - MF53 dotted.path support
  
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/phar.c?r1=1.371&r2=1.372&diff_format=u
Index: php-src/ext/phar/phar.c
diff -u php-src/ext/phar/phar.c:1.371 php-src/ext/phar/phar.c:1.372
--- php-src/ext/phar/phar.c:1.371       Tue May 13 18:35:25 2008
+++ php-src/ext/phar/phar.c     Tue May 13 18:43:18 2008
@@ -17,7 +17,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: phar.c,v 1.371 2008/05/13 18:35:25 sfox Exp $ */
+/* $Id: phar.c,v 1.372 2008/05/13 18:43:18 sfox Exp $ */
 
 #define PHAR_MAIN 1
 #include "phar_internal.h"
@@ -1606,7 +1606,7 @@
                                        
zend_hash_move_forward(&(PHAR_GLOBALS->phar_fname_map));
                                        continue;
                                }
-                               if (!memcmp(filename, key.s, keylen) && 
(filename_len == keylen
+                               if (!memcmp(filename, key.s, keylen) && 
((uint)filename_len == keylen
                                        || filename[keylen] == '/' || 
filename[keylen] == '\0')) {
                                        if (FAILURE == 
zend_hash_get_current_data(&(PHAR_GLOBALS->phar_fname_map), (void **) &pphar)) {
                                                break;
@@ -1653,9 +1653,6 @@
                        return SUCCESS;
                case FAILURE :
                        /* look for more extensions */
-                       if (is_complete) {
-                               return FAILURE;
-                       }
                        pos = strchr(pos + 1, '.');
                        if (pos) {
                                *ext_str = NULL;
@@ -3026,7 +3023,7 @@
        php_info_print_table_header(2, "Phar: PHP Archive support", "enabled");
        php_info_print_table_row(2, "Phar EXT version", PHP_PHAR_VERSION);
        php_info_print_table_row(2, "Phar API version", PHP_PHAR_API_VERSION);
-       php_info_print_table_row(2, "CVS revision", "$Revision: 1.371 $");
+       php_info_print_table_row(2, "CVS revision", "$Revision: 1.372 $");
        php_info_print_table_row(2, "Phar-based phar archives", "enabled");
        php_info_print_table_row(2, "Tar-based phar archives", "enabled");
        php_info_print_table_row(2, "ZIP-based phar archives", "enabled");
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tests/phar_dotted_path.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/phar/tests/phar_dotted_path.phpt
diff -u /dev/null php-src/ext/phar/tests/phar_dotted_path.phpt:1.2
--- /dev/null   Tue May 13 18:43:18 2008
+++ php-src/ext/phar/tests/phar_dotted_path.phpt        Tue May 13 18:43:18 2008
@@ -0,0 +1,40 @@
+--TEST--
+Phar: create new Phar with broken.dirname in path
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--INI--
+phar.readonly=0
+phar.require_hash=0
+--FILE--
+<?php
+
+$dir = dirname(__FILE__) . '/broken.dirname';
+mkdir($dir, 0777);
+
+$fname = $dir . '/dotted_path.phar';
+$stub = Phar::createDefaultStub();
+$file = $stub;
+
+$files = array();
+$files['a'] = 'this is a';
+$files['b'] = 'this is b';
+
+include 'files/phar_test.inc';
+
+$phar = new Phar($fname);
+
+foreach ($phar as $entry) {
+    echo file_get_contents($entry)."\n";
+}
+
+?>
+===DONE===
+--CLEAN--
+<?php
+unlink(dirname(__FILE__) . '/broken.dirname/dotted_path.phar');
+rmdir(dirname(__FILE__) . '/broken.dirname');
+?>
+--EXPECT--
+this is a
+this is b
+===DONE===



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to