From 336cb15d69979ee5cc5d9dcd6d25960b6ffbc17d Mon Sep 17 00:00:00 2001 From: Hannes Magnusson Date: Tue, 9 Dec 2008 09:03:38 +0000 Subject: [PATCH] MFH: - Changed opendir/dir/scandir to use default context when no context argument is passed. (Sara) --- NEWS | 2 ++ ext/standard/dir.c | 8 ++------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/NEWS b/NEWS index fdbf6c6f26..9cd8a8cb7e 100644 --- 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) diff --git a/ext/standard/dir.c b/ext/standard/dir.c index b58dd533ec..c5d9b29b05 100644 --- a/ext/standard/dir.c +++ b/ext/standard/dir.c @@ -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); -- 2.50.1