MantisBT: master 36044d26

Author Committer Branch Timestamp Parent
raspopov community master 2026-05-05 03:54 master 898d8680
Affected Issues  0037098: Unnecessary token requests from the database on the issue page
Changeset

Add a cache for tokens retrieved from the database

A cache of tokens retrieved from the database has been added as
a new global variable, $g_cache_token.

The chosen cache format simplifies the process of obtaining a token and
storing it in the cache, but makes it more complicated to verify
the token ID; however, in practice, this does not reduce the cache's
efficiency due to the optimal order of function calls in MantisBT.

In addition, the code explicitly casts token identifiers to integers
throughout.

Fixes 0037098, https://github.com/mantisbt/mantisbt/pull/2210

mod - core/tokens_api.php Diff File
add - tests/Mantis/TokensApiTest.php Diff File