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

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

diff --git a/NEWS b/NEWS
index 8176553e046ddb2768fe5739dfc5a86d3fd93d27..0fa38d1c0e4703656e0d6e7c4e1011c92dfb6ac4 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,8 @@
 PHP 4                                                                      NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ? ? ??? 200?, Version 4.4.0
+- Fixed bug #20424 (stream_get_meta_data craches on a normal file stream).
+  (Derick, Wez)
 - Added imagefilter() function which allows application of various filters.
   This function is only available with bundled GD. (Pierre-Alain Joye, Ilia)
 
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 = {