lbarnaud                Mon Nov  3 15:47:05 2008 UTC

  Added files:                 
    /php-src/ext/standard/tests/file    bug43353.phpt 

  Modified files:              
    /php-src/main/streams       streams.c 
  Log:
  Fixed bug #43353 (wrong detection of 'data' wrapper causes notice)
  
  
http://cvs.php.net/viewvc.cgi/php-src/main/streams/streams.c?r1=1.170&r2=1.171&diff_format=u
Index: php-src/main/streams/streams.c
diff -u php-src/main/streams/streams.c:1.170 
php-src/main/streams/streams.c:1.171
--- php-src/main/streams/streams.c:1.170        Mon Sep 22 01:26:38 2008
+++ php-src/main/streams/streams.c      Mon Nov  3 15:47:05 2008
@@ -19,7 +19,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: streams.c,v 1.170 2008/09/22 01:26:38 cellog Exp $ */
+/* $Id: streams.c,v 1.171 2008/11/03 15:47:05 lbarnaud Exp $ */
 
 #define _GNU_SOURCE
 #include "php.h"
@@ -2076,7 +2076,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