lbarnaud                Mon Nov  3 15:48:05 2008 UTC

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

  Modified files:              
    /php-src    NEWS 
    /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/NEWS?r1=1.2027.2.547.2.1294&r2=1.2027.2.547.2.1295&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.1294 php-src/NEWS:1.2027.2.547.2.1295
--- php-src/NEWS:1.2027.2.547.2.1294    Mon Nov  3 15:41:35 2008
+++ php-src/NEWS        Mon Nov  3 15:48:05 2008
@@ -28,6 +28,7 @@
 - Fixed bug #43452 (strings containing a weekday, or a number plus weekday
   behaved incorrect of the current day-of-week was the same as the one in the
   phrase).(Derick)
+- Fixed bug #43353 (wrong detection of 'data' wrapper causes notice). (Arnaud)
 - Fixed bug #42855 (dns_get_record() doesn't return all text from TXT record).
   (a dot u dot savchuk at gmail dot com)
 - Fixed bug #42718 (FILTER_UNSAFE_RAW not applied when configured as default
http://cvs.php.net/viewvc.cgi/php-src/main/streams/streams.c?r1=1.82.2.6.2.26&r2=1.82.2.6.2.27&diff_format=u
Index: php-src/main/streams/streams.c
diff -u php-src/main/streams/streams.c:1.82.2.6.2.26 
php-src/main/streams/streams.c:1.82.2.6.2.27
--- php-src/main/streams/streams.c:1.82.2.6.2.26        Mon Sep 22 01:25:44 2008
+++ php-src/main/streams/streams.c      Mon Nov  3 15:48:05 2008
@@ -19,7 +19,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: streams.c,v 1.82.2.6.2.26 2008/09/22 01:25:44 cellog Exp $ */
+/* $Id: streams.c,v 1.82.2.6.2.27 2008/11/03 15:48:05 lbarnaud Exp $ */
 
 #define _GNU_SOURCE
 #include "php.h"
@@ -1511,7 +1511,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