ID: 47037
Updated by: [email protected]
Reported By: yarontal12 at gmail dot com
-Status: Open
+Status: Assigned
Bug Type: Filesystem function related
Operating System: Win XP
PHP Version: 5.2CVS-2009-01-08 (snap)
-Assigned To:
+Assigned To: felipe
Previous Comments:
------------------------------------------------------------------------
[2009-01-08 15:48:16] crrodriguez at opensuse dot org
Yeah, I agree with you.
Index: main/streams/streams.c
===================================================================
RCS file: /repository/php-src/main/streams/streams.c,v
retrieving revision 1.82.2.6.2.31
diff -u -p -r1.82.2.6.2.31 streams.c
--- main/streams/streams.c 24 Nov 2008 15:37:33 -0000
1.82.2.6.2.31
+++ main/streams/streams.c 8 Jan 2009 15:47:34 -0000
@@ -1763,6 +1763,7 @@ PHPAPI php_stream *_php_stream_open_wrap
}
if (!path || !*path) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Filename
cannot be empty");
return NULL;
}
------------------------------------------------------------------------
[2009-01-08 14:37:31] yarontal12 at gmail dot com
Description:
------------
$fh = fopen("", "r");
that doesn't produce an error, but doesn't return a valid stream
either.
Same problem with passing NULL or ''.
Reproduce code:
---------------
$fh = fopen("", "r");
Expected result:
----------------
Warning: fopen() [function.fopen]: failed to open stream: No such file
or directory in test.php on line 2
Actual result:
--------------
nothing
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=47037&edit=1