felipe Fri Jul 25 13:39:39 2008 UTC
Modified files:
/php-src/main main.c
Log:
- Fixed the parameter type expected. set_time_limit() should accept only
integer.
http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.774&r2=1.775&diff_format=u
Index: php-src/main/main.c
diff -u php-src/main/main.c:1.774 php-src/main/main.c:1.775
--- php-src/main/main.c:1.774 Fri Jul 25 12:14:36 2008
+++ php-src/main/main.c Fri Jul 25 13:39:39 2008
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: main.c,v 1.774 2008/07/25 12:14:36 felipe Exp $ */
+/* $Id: main.c,v 1.775 2008/07/25 13:39:39 felipe Exp $ */
/* {{{ includes
*/
@@ -1120,18 +1120,22 @@
Sets the maximum time a script can run */
PHP_FUNCTION(set_time_limit)
{
- zval **new_timeout;
+ long new_timeout;
+ char *new_timeout_str;
+ int new_timeout_strlen;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z", &new_timeout)
== FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &new_timeout)
== FAILURE) {
return;
}
+
+ new_timeout_strlen = zend_spprintf(&new_timeout_str, 0, "%ld",
new_timeout);
- convert_to_string_ex(new_timeout);
- if (zend_alter_ini_entry_ex("max_execution_time",
sizeof("max_execution_time"), Z_STRVAL_PP(new_timeout),
Z_STRLEN_PP(new_timeout), PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC) ==
SUCCESS) {
- RETURN_TRUE;
+ if (zend_alter_ini_entry_ex("max_execution_time",
sizeof("max_execution_time"), new_timeout_str, new_timeout_strlen,
PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC) == SUCCESS) {
+ RETVAL_TRUE;
} else {
- RETURN_FALSE;
+ RETVAL_FALSE;
}
+ efree(new_timeout_str);
}
/* }}} */
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php