mirror of
https://github.com/php/php-src.git
synced 2025-01-21 19:24:16 +08:00
- Added missing void param check in sys_get_temp_dir
- Fixed param check of umask()
This commit is contained in:
parent
b9746b0ba6
commit
d8782ddaeb
@ -1413,7 +1413,10 @@ PHP_FUNCTION(umask)
|
||||
{
|
||||
long arg1 = 0;
|
||||
int oldumask;
|
||||
int arg_count = ZEND_NUM_ARGS();
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &arg1) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
oldumask = umask(077);
|
||||
|
||||
@ -1421,12 +1424,9 @@ PHP_FUNCTION(umask)
|
||||
BG(umask) = oldumask;
|
||||
}
|
||||
|
||||
if (arg_count == 0) {
|
||||
if (ZEND_NUM_ARGS() == 0) {
|
||||
umask(oldumask);
|
||||
} else {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &arg1) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
umask(arg1);
|
||||
}
|
||||
|
||||
@ -2491,6 +2491,9 @@ PHP_FUNCTION(fnmatch)
|
||||
Returns directory path used for temporary files */
|
||||
PHP_FUNCTION(sys_get_temp_dir)
|
||||
{
|
||||
if (zend_parse_parameters_none() == FAILURE) {
|
||||
return;
|
||||
}
|
||||
RETURN_STRING((char *)php_get_temporary_directory(), 1);
|
||||
}
|
||||
/* }}} */
|
||||
|
Loading…
Reference in New Issue
Block a user