]> granicus.if.org Git - php/commitdiff
change ini handlers to produce E_ERROR if they are called during startup or per request
authorAntony Dovgal <tony2001@php.net>
Wed, 30 Aug 2006 16:24:31 +0000 (16:24 +0000)
committerAntony Dovgal <tony2001@php.net>
Wed, 30 Aug 2006 16:24:31 +0000 (16:24 +0000)
ext/session/session.c

index 008b57045bac9bf02c6ea8876fb2a5a680489245..b86336c4e8e9f9c151e4339208d5f408d888217a 100644 (file)
@@ -98,7 +98,13 @@ static PHP_INI_MH(OnUpdateSaveHandler)
        tmp = _php_find_ps_module(new_value TSRMLS_CC);
 
        if (PG(modules_activated) && !tmp) {
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot find save handler %s", new_value);
+               int err_type;
+               if (stage == ZEND_INI_STAGE_RUNTIME) {
+                       err_type = E_WARNING;
+               } else {
+                       err_type = E_ERROR;
+               }
+               php_error_docref(NULL TSRMLS_CC, E_ERROR, "Cannot find save handler %s", new_value);
                return FAILURE;
        }
        PS(mod) = tmp;
@@ -127,7 +133,13 @@ static PHP_INI_MH(OnUpdateSerializer)
        tmp = _php_find_ps_serializer(new_value TSRMLS_CC);
 
        if (PG(modules_activated) && !tmp) {
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot find serialization handler %s", new_value);
+               int err_type;
+               if (stage == ZEND_INI_STAGE_RUNTIME) {
+                       err_type = E_WARNING;
+               } else {
+                       err_type = E_ERROR;
+               }
+               php_error_docref(NULL TSRMLS_CC, err_type, "Cannot find serialization handler %s", new_value);
                return FAILURE;
        }
        PS(serializer) = tmp;