Skip to content

Commit af67b06

Browse files
alexdowadcmb69
authored andcommitted
SessionUpdateTimestampHandler class was never implemented
It seems that in 2015, work was being done so that users could add their own custom session handlers. The implementer intended to add a class called SessionUpdateTimestampHandler, but never did so. The variable which was intended to point to its class entry is never initialized. The implementer also coded two methods for this class. Strangely, the method bodies are declared with PHP_METHOD(SessionHandler, ...) rather than PHP(SessionUpdateTimestampHandler, ...). However, these method implementations are not added to the method table of any class or interface. They are just dead code.
1 parent a447897 commit af67b06

File tree

3 files changed

+0
-39
lines changed

3 files changed

+0
-39
lines changed

ext/session/mod_user_class.c

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -176,37 +176,3 @@ PHP_METHOD(SessionHandler, create_sid)
176176
RETURN_STR(id);
177177
}
178178
/* }}} */
179-
180-
/* {{{ proto char SessionUpdateTimestampHandler::validateId(string id)
181-
Simply return TRUE */
182-
PHP_METHOD(SessionHandler, validateId)
183-
{
184-
zend_string *key;
185-
186-
PS_SANITY_CHECK_IS_OPEN;
187-
188-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &key) == FAILURE) {
189-
RETURN_THROWS();
190-
}
191-
192-
/* Legacy save handler may not support validate_sid API. Return TRUE. */
193-
RETURN_TRUE;
194-
}
195-
/* }}} */
196-
197-
/* {{{ proto bool SessionUpdateTimestampHandler::updateTimestamp(string id, string data)
198-
Simply call update_timestamp */
199-
PHP_METHOD(SessionHandler, updateTimestamp)
200-
{
201-
zend_string *key, *val;
202-
203-
PS_SANITY_CHECK_IS_OPEN;
204-
205-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS", &key, &val) == FAILURE) {
206-
RETURN_THROWS();
207-
}
208-
209-
/* Legacy save handler may not support update_timestamp API. Just write. */
210-
RETVAL_BOOL(SUCCESS == PS(default_mod)->s_write(&PS(mod_data), key, val, PS(gc_maxlifetime)));
211-
}
212-
/* }}} */

ext/session/php_session.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,5 @@ extern PHP_METHOD(SessionHandler, write);
325325
extern PHP_METHOD(SessionHandler, destroy);
326326
extern PHP_METHOD(SessionHandler, gc);
327327
extern PHP_METHOD(SessionHandler, create_sid);
328-
extern PHP_METHOD(SessionHandler, validateId);
329-
extern PHP_METHOD(SessionHandler, updateTimestamp);
330328

331329
#endif

ext/session/session.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,6 @@ zend_class_entry *php_session_iface_entry;
7070
/* SessionIdInterface */
7171
zend_class_entry *php_session_id_iface_entry;
7272

73-
/* SessionUpdateTimestampHandler class */
74-
zend_class_entry *php_session_update_timestamp_class_entry;
75-
7673
/* SessionUpdateTimestampInterface */
7774
zend_class_entry *php_session_update_timestamp_iface_entry;
7875

0 commit comments

Comments
 (0)