diff --git a/ext/session/session.c b/ext/session/session.c index 8619c3fe629..e16b79f5859 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -689,19 +689,11 @@ static PHP_INI_MH(OnUpdateSaveDir) /* {{{ */ static PHP_INI_MH(OnUpdateName) /* {{{ */ { - /* Don't accept a blank session name from php.ini or -d session.name= */ - if (!PG(modules_activated) && !new_value_length) { - /* Force the default value. */ - new_value = "PHPSESSID"; - new_value_length = 9; - } - /* Numeric session.name won't work at all */ - if (PG(modules_activated) && - (!new_value_length || is_numeric_string(new_value, new_value_length, NULL, NULL, 0))) { + if ((!new_value_length || is_numeric_string(new_value, new_value_length, NULL, NULL, 0))) { int err_type; - if (stage == ZEND_INI_STAGE_RUNTIME) { + if (stage == ZEND_INI_STAGE_RUNTIME || stage == ZEND_INI_STAGE_ACTIVATE || stage == ZEND_INI_STAGE_STARTUP) { err_type = E_WARNING; } else { err_type = E_ERROR; diff --git a/ext/session/tests/bug66481.phpt b/ext/session/tests/bug66481.phpt index 0479b5ff4d2..cf6ad6a8d66 100644 --- a/ext/session/tests/bug66481.phpt +++ b/ext/session/tests/bug66481.phpt @@ -9,8 +9,9 @@ session.name= var_dump(session_name("foo")); var_dump(session_name("bar")); - --EXPECTF-- +PHP Warning: PHP Startup: session.name cannot be a numeric or empty '' in Unknown on line 0 + +Warning: PHP Startup: session.name cannot be a numeric or empty '' in Unknown on line 0 string(9) "PHPSESSID" string(3) "foo" -