]> granicus.if.org Git - php/commitdiff
MFH: - Changed opendir/dir/scandir to use default context when no context argument...
authorHannes Magnusson <bjori@php.net>
Tue, 9 Dec 2008 09:03:38 +0000 (09:03 +0000)
committerHannes Magnusson <bjori@php.net>
Tue, 9 Dec 2008 09:03:38 +0000 (09:03 +0000)
NEWS
ext/standard/dir.c

diff --git a/NEWS b/NEWS
index fdbf6c6f26b82b49dddfd4df275dd81b2eb84215..9cd8a8cb7e477958db93c533e36fee85c595be16 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,8 @@
 PHP                                                                        NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? ??? 200?, PHP 5.3.0 Alpha 4
+- Changed opendir/dir/scandir to use default context
+  when no context argument is passed. (Sara)
 
 04 Dec 2008, PHP 5.3.0 Alpha 3
 - Upgraded bundled PCRE to version 7.8. (Nuno)
index b58dd533ecd69e82a5b176658cc53a738285bee7..c5d9b29b056577b02efd25fa34e77c90dff66a70 100644 (file)
@@ -213,9 +213,7 @@ static void _php_do_opendir(INTERNAL_FUNCTION_PARAMETERS, int createobject)
                RETURN_NULL();
        }
 
-       if (zcontext) {
-               context = php_stream_context_from_zval(zcontext, 0);
-       }
+       context = php_stream_context_from_zval(zcontext, 0);
        
        dirp = php_stream_opendir(dirname, ENFORCE_SAFE_MODE|REPORT_ERRORS, context);
 
@@ -558,9 +556,7 @@ PHP_FUNCTION(scandir)
                RETURN_FALSE;
        }
 
-       if (zcontext) {
-               context = php_stream_context_from_zval(zcontext, 0);
-       }
+       context = php_stream_context_from_zval(zcontext, 0);
 
        if (!flags) {
                n = php_stream_scandir(dirn, &namelist, context, (void *) php_stream_dirent_alphasort);