lbarnaud                Mon Nov  3 15:47:31 2008 UTC

  Added files:                 (Branch: PHP_5_3)
    /php-src/ext/standard/tests/file    bug43353.phpt 

  Modified files:              
    /php-src/main/streams       streams.c 
  Log:
  MFH: Fixed bug #43353 (wrong detection of 'data' wrapper causes notice)
  
  
http://cvs.php.net/viewvc.cgi/php-src/main/streams/streams.c?r1=1.82.2.6.2.18.2.15&r2=1.82.2.6.2.18.2.16&diff_format=u
Index: php-src/main/streams/streams.c
diff -u php-src/main/streams/streams.c:1.82.2.6.2.18.2.15 
php-src/main/streams/streams.c:1.82.2.6.2.18.2.16
--- php-src/main/streams/streams.c:1.82.2.6.2.18.2.15   Mon Sep 22 01:26:14 2008
+++ php-src/main/streams/streams.c      Mon Nov  3 15:47:31 2008
@@ -19,7 +19,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: streams.c,v 1.82.2.6.2.18.2.15 2008/09/22 01:26:14 cellog Exp $ */
+/* $Id: streams.c,v 1.82.2.6.2.18.2.16 2008/11/03 15:47:31 lbarnaud Exp $ */
 
 #define _GNU_SOURCE
 #include "php.h"
@@ -1521,7 +1521,7 @@
                n++;
        }
 
-       if ((*p == ':') && (n > 1) && (!strncmp("//", p+1, 2) || 
!memcmp("data", path, 4))) {
+       if ((*p == ':') && (n > 1) && (!strncmp("//", p+1, 2) || (n == 4 && 
!memcmp("data:", path, 5)))) {
                protocol = path;
        } else if (n == 5 && strncasecmp(path, "zlib:", 5) == 0) {
                /* BC with older php scripts and zlib wrapper */

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/bug43353.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/file/bug43353.phpt
+++ php-src/ext/standard/tests/file/bug43353.phpt
--TEST--
Bug #43353 wrong detection of 'data' wrapper
--FILE--
<?php

var_dump(is_dir('file:///datafoo:test'));
var_dump(is_dir('datafoo:test'));
var_dump(file_get_contents('data:text/plain,foo'));
var_dump(file_get_contents('datafoo:text/plain,foo'));

?>
--EXPECTF--
bool(false)
bool(false)
string(3) "foo"

Warning: file_get_contents(datafoo:text/plain,foo): failed to open stream: No 
such file or directory in %s
bool(false)



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

Reply via email to