]> granicus.if.org Git - php/commitdiff
- Fixed bug #20424 (stream_get_meta_data craches on a normal file stream).
authorDerick Rethans <derick@php.net>
Thu, 14 Nov 2002 10:52:45 +0000 (10:52 +0000)
committerDerick Rethans <derick@php.net>
Thu, 14 Nov 2002 10:52:45 +0000 (10:52 +0000)
  (Derick, Wez)

NEWS
ext/standard/tests/file/bug20424.phpt [new file with mode: 0644]
main/streams.c

diff --git a/NEWS b/NEWS
index 8f0e2e418b91f66e4b1f6e9b8ce26c23e36ac627..1fa18430686349e05ba5e8be5ef8d59c6847f99e 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,8 @@ PHP 4                                                                      NEWS
 - Moved extensions to PECL (http://pear.php.net/): (James, Derick)
   . ext/vpopmail
   . ext/cybermut
+- Fixed bug #20424 (stream_get_meta_data craches on a normal file stream).
+  (Derick, Wez)
 - Added "neutral" language entry to mbstring spec. (Moriyoshi) 
 - Modified log() to accept multiple bases. (Jason)
 - Added gd_info() which returns an array of gd support information. (Marcus)
diff --git a/ext/standard/tests/file/bug20424.phpt b/ext/standard/tests/file/bug20424.phpt
new file mode 100644 (file)
index 0000000..0352d46
--- /dev/null
@@ -0,0 +1,12 @@
+--TEST--
+Bug #20424: stream_get_meta_data craches on a normal file stream
+--POST--
+--GET--
+--FILE--
+<?php
+$f = fopen("run-tests.php", "r");
+$dummy = var_export(stream_get_meta_data($f), TRUE);
+echo "I'm alive!\n";
+?>
+--EXPECT--
+I'm alive!
index 1a27c7c4db6ef8d66aff851edd6e17b53176780b..f6190498c45d2bbf99d7798793fd021e1889b304 100755 (executable)
@@ -2029,7 +2029,8 @@ static php_stream_wrapper_ops php_plain_files_wrapper_ops = {
        NULL,
        NULL,
        php_plain_files_url_stater,
-       php_plain_files_dir_opener
+       php_plain_files_dir_opener,
+       "plainfile"
 };
 
 static php_stream_wrapper php_plain_files_wrapper = {