Skip to content

Commit f6088f5

Browse files
committed
ext/session: remove session_adapt_url() function
This is unused and only exist for the deprecated (and dangerous) GET/POST session ID feature
1 parent 1041a47 commit f6088f5

3 files changed

Lines changed: 1 addition & 13 deletions

File tree

UPGRADING.INTERNALS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ PHP 8.6 INTERNALS UPGRADE NOTES
9999

100100
- ext/session:
101101
. php_session_flush() now returns a bool rather than a zend_result.
102+
. Removed session_adapt_url().
102103

103104
- ext/standard:
104105
. _php_error_log() now has a formal return type of zend_result.

ext/session/php_session.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,6 @@ PHPAPI zend_string *php_session_create_id(PS_CREATE_SID_ARGS);
248248
PHPAPI zend_result php_session_validate_sid(PS_VALIDATE_SID_ARGS);
249249
PHPAPI zend_result php_session_update_timestamp(PS_UPDATE_TIMESTAMP_ARGS);
250250

251-
PHPAPI void session_adapt_url(const char *url, size_t url_len, char **new_url, size_t *new_len);
252-
253251
PHPAPI zend_result php_session_destroy(void);
254252
PHPAPI void php_add_session_var(zend_string *name);
255253
PHPAPI zval *php_set_session_var(zend_string *name, zval *state_val, php_unserialize_data_t *var_hash);

ext/session/session.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1756,17 +1756,6 @@ static bool php_session_reset(void)
17561756
return false;
17571757
}
17581758

1759-
1760-
/* This API is not used by any PHP modules including session currently.
1761-
session_adapt_url() may be used to set Session ID to target url without
1762-
starting "URL-Rewriter" output handler. */
1763-
PHPAPI void session_adapt_url(const char *url, size_t url_len, char **new_url, size_t *new_len)
1764-
{
1765-
if (APPLY_TRANS_SID && (PS(session_status) == php_session_active)) {
1766-
*new_url = php_url_scanner_adapt_single_url(url, url_len, ZSTR_VAL(PS(session_name)), ZSTR_VAL(PS(id)), new_len, true);
1767-
}
1768-
}
1769-
17701759
/* ********************************
17711760
* Userspace exported functions *
17721761
******************************** */

0 commit comments

Comments
 (0)