]> granicus.if.org Git - php/commitdiff
SessionUpdateTimestampHandler class was never implemented
authorAlex Dowad <alexinbeijing@gmail.com>
Mon, 27 Apr 2020 08:26:51 +0000 (10:26 +0200)
committerChristoph M. Becker <cmbecker69@gmx.de>
Mon, 27 Apr 2020 12:51:33 +0000 (14:51 +0200)
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.

ext/session/mod_user_class.c
ext/session/php_session.h
ext/session/session.c

index 1415b407a5125934e331a6433928aa10ad544ee6..f1a90912516b146f54cd4f444771b8d97a81ddf2 100644 (file)
@@ -176,37 +176,3 @@ PHP_METHOD(SessionHandler, create_sid)
        RETURN_STR(id);
 }
 /* }}} */
-
-/* {{{ proto char SessionUpdateTimestampHandler::validateId(string id)
-   Simply return TRUE */
-PHP_METHOD(SessionHandler, validateId)
-{
-       zend_string *key;
-
-       PS_SANITY_CHECK_IS_OPEN;
-
-       if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &key) == FAILURE) {
-               RETURN_THROWS();
-       }
-
-       /* Legacy save handler may not support validate_sid API. Return TRUE. */
-       RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool SessionUpdateTimestampHandler::updateTimestamp(string id, string data)
-   Simply call update_timestamp */
-PHP_METHOD(SessionHandler, updateTimestamp)
-{
-       zend_string *key, *val;
-
-       PS_SANITY_CHECK_IS_OPEN;
-
-       if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS", &key, &val) == FAILURE) {
-               RETURN_THROWS();
-       }
-
-       /* Legacy save handler may not support update_timestamp API. Just write. */
-       RETVAL_BOOL(SUCCESS == PS(default_mod)->s_write(&PS(mod_data), key, val, PS(gc_maxlifetime)));
-}
-/* }}} */
index 34987992eae679e58cf690e6daa9f8a1bf87c022..6f9664402486e6e6dec295a1596e4ccffea6314a 100644 (file)
@@ -325,7 +325,5 @@ extern PHP_METHOD(SessionHandler, write);
 extern PHP_METHOD(SessionHandler, destroy);
 extern PHP_METHOD(SessionHandler, gc);
 extern PHP_METHOD(SessionHandler, create_sid);
-extern PHP_METHOD(SessionHandler, validateId);
-extern PHP_METHOD(SessionHandler, updateTimestamp);
 
 #endif
index 60157b33564b83fa3c5a2d8c6139a57a617c0c58..8b97bb62ad35e33a56d42744d395163217c5cbce 100644 (file)
@@ -70,9 +70,6 @@ zend_class_entry *php_session_iface_entry;
 /* SessionIdInterface */
 zend_class_entry *php_session_id_iface_entry;
 
-/* SessionUpdateTimestampHandler class */
-zend_class_entry *php_session_update_timestamp_class_entry;
-
 /* SessionUpdateTimestampInterface */
 zend_class_entry *php_session_update_timestamp_iface_entry;