summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Zend/zend_ini.c22
-rw-r--r--Zend/zend_ini.h1
-rw-r--r--main/main.c2
3 files changed, 24 insertions, 1 deletions
diff --git a/Zend/zend_ini.c b/Zend/zend_ini.c
index c4951acee9..257c0152a2 100644
--- a/Zend/zend_ini.c
+++ b/Zend/zend_ini.c
@@ -530,6 +530,28 @@ ZEND_API ZEND_INI_MH(OnUpdateLong)
return SUCCESS;
}
+ZEND_API ZEND_INI_MH(OnUpdateLongGEZero)
+{
+ long *p, tmp;
+#ifndef ZTS
+ char *base = (char *) mh_arg2;
+#else
+ char *base;
+
+ base = (char *) ts_resource(*((int *) mh_arg2));
+#endif
+
+ tmp = zend_atoi(new_value, new_value_length);
+ if (tmp < 0) {
+ return FAILURE;
+ }
+
+ p = (long *) (base+(size_t) mh_arg1);
+ *p = tmp;
+
+ return SUCCESS;
+}
+
ZEND_API ZEND_INI_MH(OnUpdateReal)
{
diff --git a/Zend/zend_ini.h b/Zend/zend_ini.h
index d0f1321b94..e780ad5496 100644
--- a/Zend/zend_ini.h
+++ b/Zend/zend_ini.h
@@ -175,6 +175,7 @@ END_EXTERN_C()
BEGIN_EXTERN_C()
ZEND_API ZEND_INI_MH(OnUpdateBool);
ZEND_API ZEND_INI_MH(OnUpdateLong);
+ZEND_API ZEND_INI_MH(OnUpdateLongGEZero);
ZEND_API ZEND_INI_MH(OnUpdateReal);
ZEND_API ZEND_INI_MH(OnUpdateString);
ZEND_API ZEND_INI_MH(OnUpdateStringUnempty);
diff --git a/main/main.c b/main/main.c
index 8e6cd90fe8..aca1568958 100644
--- a/main/main.c
+++ b/main/main.c
@@ -284,7 +284,7 @@ PHP_INI_BEGIN()
STD_PHP_INI_BOOLEAN("y2k_compliance", "1", PHP_INI_ALL, OnUpdateBool, y2k_compliance, php_core_globals, core_globals)
STD_PHP_INI_ENTRY("unserialize_callback_func", NULL, PHP_INI_ALL, OnUpdateString, unserialize_callback_func, php_core_globals, core_globals)
- STD_PHP_INI_ENTRY("serialize_precision", "100", PHP_INI_ALL, OnUpdateLong, serialize_precision, php_core_globals, core_globals)
+ STD_PHP_INI_ENTRY("serialize_precision", "100", PHP_INI_ALL, OnUpdateLongGEZero, serialize_precision, php_core_globals, core_globals)
STD_PHP_INI_ENTRY("arg_separator.output", "&", PHP_INI_ALL, OnUpdateStringUnempty, arg_separator.output, php_core_globals, core_globals)
STD_PHP_INI_ENTRY("arg_separator.input", "&", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateStringUnempty, arg_separator.input, php_core_globals, core_globals)