Grokbase Groups PHP php-cvs June 2011
FAQ
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);
}
/* }}} */

Search Discussions

  • Felipe Pena at Jun 19, 2011 at 2:50 pm
    felipe Sun, 19 Jun 2011 14:50:44 +0000

    Revision: http://svn.php.net/viewvc?view=revision&revision=312285

    Log:
    - Opss, restore old behavior

    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 14:27:33 UTC (rev 312284)
    +++ php/php-src/branches/PHP_5_3/ext/standard/file.c 2011-06-19 14:50:44 UTC (rev 312285)
    @@ -1499,15 +1499,15 @@
    long arg1 = 0;
    int oldumask;

    - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &arg1) == FAILURE) {
    - RETURN_FALSE;
    - }
    -
    oldumask = umask(077);

    if (BG(umask) == -1) {
    BG(umask) = oldumask;
    }
    +
    + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &arg1) == FAILURE) {
    + RETURN_FALSE;
    + }

    if (ZEND_NUM_ARGS() == 0) {
    umask(oldumask);

    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 14:27:33 UTC (rev 312284)
    +++ php/php-src/branches/PHP_5_4/ext/standard/file.c 2011-06-19 14:50:44 UTC (rev 312285)
    @@ -1414,15 +1414,15 @@
    long arg1 = 0;
    int oldumask;

    - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &arg1) == FAILURE) {
    - RETURN_FALSE;
    - }
    -
    oldumask = umask(077);

    if (BG(umask) == -1) {
    BG(umask) = oldumask;
    }
    +
    + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &arg1) == FAILURE) {
    + RETURN_FALSE;
    + }

    if (ZEND_NUM_ARGS() == 0) {
    umask(oldumask);

    Modified: php/php-src/trunk/ext/standard/file.c
    ===================================================================
    --- php/php-src/trunk/ext/standard/file.c 2011-06-19 14:27:33 UTC (rev 312284)
    +++ php/php-src/trunk/ext/standard/file.c 2011-06-19 14:50:44 UTC (rev 312285)
    @@ -1414,15 +1414,15 @@
    long arg1 = 0;
    int oldumask;

    - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &arg1) == FAILURE) {
    - RETURN_FALSE;
    - }
    -
    oldumask = umask(077);

    if (BG(umask) == -1) {
    BG(umask) = oldumask;
    }
    +
    + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &arg1) == FAILURE) {
    + RETURN_FALSE;
    + }

    if (ZEND_NUM_ARGS() == 0) {
    umask(oldumask);

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupphp-cvs @
categoriesphp
postedJun 19, '11 at 2:27p
activeJun 19, '11 at 2:50p
posts2
users1
websitephp.net

1 user in discussion

Felipe Pena: 2 posts

People

Translate

site design / logo © 2019 Grokbase