svn: /php/php-src/ branches/PHP_5_3/ext/standard/file.c branches/PHP_5_4/ext/standard/file.c trunk/ext/standard/file.c
| From: | Felipe Pena | Date: | Sun, 19 Jun 2011 14:27:33 +0000 |
| Subject: | svn: /php/php-src/ branches/PHP_5_3/ext/standard/file.c branches/PHP_5_4/ext/standard/file.c trunk/ext/standard/file.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-65270@lists.php.net to get a copy of this message | ||
felipe Sun, 19 Jun 2011 14:27:33 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=312284
Log:
- Added missing void param check in sys_get_temp_dir
- Fixed param check of umask()
Changed paths:
U php/php-src/branches/PHP_5_3/ext/standard/file.c
U php/php-src/branches/PHP_5_4/ext/standard/file.c
U php/php-src/trunk/ext/standard/file.c
Modified: php/php-src/branches/PHP_5_3/ext/standard/file.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/standard/file.c 2011-06-19 13:39:50 UTC (rev 312283)
+++ php/php-src/branches/PHP_5_3/ext/standard/file.c 2011-06-19 14:27:33 UTC (rev 312284)
@@ -1498,7 +1498,10 @@
{
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);
@@ -1506,12 +1509,9 @@
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);
}
@@ -2605,6 +2605,9 @@
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);
}
/* }}} */
Modified: php/php-src/branches/PHP_5_4/ext/standard/file.c
===================================================================
--- php/php-src/branches/PHP_5_4/ext/standard/file.c 2011-06-19 13:39:50 UTC (rev 312283)
+++ php/php-src/branches/PHP_5_4/ext/standard/file.c 2011-06-19 14:27:33 UTC (rev 312284)
@@ -1413,7 +1413,10 @@
{
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 @@
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 @@
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);
}
/* }}} */
Modified: php/php-src/trunk/ext/standard/file.c
===================================================================
--- php/php-src/trunk/ext/standard/file.c 2011-06-19 13:39:50 UTC (rev 312283)
+++ php/php-src/trunk/ext/standard/file.c 2011-06-19 14:27:33 UTC (rev 312284)
@@ -1413,7 +1413,10 @@
{
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 @@
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 @@
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);
}
/* }}} */