Skip to content

Commit a03786f

Browse files
author
Yasuo Ohgaki
committed
Use distinguishable error messages.
1 parent 310fc87 commit a03786f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ext/session/session.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2074,12 +2074,12 @@ static PHP_FUNCTION(session_regenerate_id)
20742074
PS(id) = PS(mod)->s_create_sid(&PS(mod_data));
20752075
if (!PS(id)) {
20762076
PS(session_status) = php_session_none;
2077-
php_error_docref(NULL, E_RECOVERABLE_ERROR, "Failed to create session ID: %s (path: %s)", PS(mod)->s_name, PS(save_path));
2077+
php_error_docref(NULL, E_RECOVERABLE_ERROR, "Failed to create new session ID: %s (path: %s)", PS(mod)->s_name, PS(save_path));
20782078
RETURN_FALSE;
20792079
}
20802080
if (PS(mod)->s_open(&PS(mod_data), PS(save_path), PS(session_name)) == FAILURE) {
20812081
PS(session_status) = php_session_none;
2082-
php_error_docref(NULL, E_RECOVERABLE_ERROR, "Failed to create session ID: %s (path: %s)", PS(mod)->s_name, PS(save_path));
2082+
php_error_docref(NULL, E_RECOVERABLE_ERROR, "Failed to create(open) session ID: %s (path: %s)", PS(mod)->s_name, PS(save_path));
20832083
RETURN_FALSE;
20842084
}
20852085
if (PS(use_strict_mode) && PS(mod)->s_validate_sid &&
@@ -2088,14 +2088,14 @@ static PHP_FUNCTION(session_regenerate_id)
20882088
PS(id) = PS(mod)->s_create_sid(&PS(mod_data));
20892089
if (!PS(id)) {
20902090
PS(session_status) = php_session_none;
2091-
php_error_docref(NULL, E_RECOVERABLE_ERROR, "Failed to create session ID: %s (path: %s)", PS(mod)->s_name, PS(save_path));
2091+
php_error_docref(NULL, E_RECOVERABLE_ERROR, "Failed to create session ID by collision: %s (path: %s)", PS(mod)->s_name, PS(save_path));
20922092
RETURN_FALSE;
20932093
}
20942094
}
20952095
/* Read is required to make new session data at this point. */
20962096
if (PS(mod)->s_read(&PS(mod_data), PS(id), &data, PS(gc_maxlifetime)) == FAILURE) {
20972097
PS(session_status) = php_session_none;
2098-
php_error_docref(NULL, E_RECOVERABLE_ERROR, "Failed to create session ID: %s (path: %s)", PS(mod)->s_name, PS(save_path));
2098+
php_error_docref(NULL, E_RECOVERABLE_ERROR, "Failed to create(read) session ID: %s (path: %s)", PS(mod)->s_name, PS(save_path));
20992099
RETURN_FALSE;
21002100
}
21012101
if (data) {

0 commit comments

Comments
 (0)