MFH: - Changed opendir/dir/scandir to use default context when no context argument is passed. (Sara)

This commit is contained in:
Hannes Magnusson 2008-12-09 09:03:38 +00:00
parent d8edbd2729
commit 336cb15d69
2 changed files with 4 additions and 6 deletions

2
NEWS
View file

@ -1,6 +1,8 @@
PHP NEWS PHP NEWS
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 200?, PHP 5.3.0 Alpha 4 ?? ??? 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 04 Dec 2008, PHP 5.3.0 Alpha 3
- Upgraded bundled PCRE to version 7.8. (Nuno) - Upgraded bundled PCRE to version 7.8. (Nuno)

View file

@ -213,9 +213,7 @@ static void _php_do_opendir(INTERNAL_FUNCTION_PARAMETERS, int createobject)
RETURN_NULL(); 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); dirp = php_stream_opendir(dirname, ENFORCE_SAFE_MODE|REPORT_ERRORS, context);
@ -558,9 +556,7 @@ PHP_FUNCTION(scandir)
RETURN_FALSE; RETURN_FALSE;
} }
if (zcontext) {
context = php_stream_context_from_zval(zcontext, 0); context = php_stream_context_from_zval(zcontext, 0);
}
if (!flags) { if (!flags) {
n = php_stream_scandir(dirn, &namelist, context, (void *) php_stream_dirent_alphasort); n = php_stream_scandir(dirn, &namelist, context, (void *) php_stream_dirent_alphasort);