X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fapi%2FApiStashEdit.php;h=d03fca87a0b58efea8c043fa32eb5b21de45f761;hp=c7a00c6464982cce4e78599f795daaad1b61e4e8;hb=89539f2aa1b158fdcc703ad053e2580cb97a6385;hpb=d56b46598d58f16eb8d7c8252083bbf3844e5430 diff --git a/includes/api/ApiStashEdit.php b/includes/api/ApiStashEdit.php index c7a00c6464..d03fca87a0 100644 --- a/includes/api/ApiStashEdit.php +++ b/includes/api/ApiStashEdit.php @@ -44,6 +44,7 @@ class ApiStashEdit extends ApiBase { const PRESUME_FRESH_TTL_SEC = 30; const MAX_CACHE_TTL = 300; // 5 minutes + const MAX_SIGNATURE_TTL = 60; public function execute() { $user = $this->getUser(); @@ -391,6 +392,12 @@ class ApiStashEdit extends ApiBase { // Put an upper limit on the TTL for sanity to avoid extreme template/file staleness. $since = time() - wfTimestamp( TS_UNIX, $parserOutput->getTimestamp() ); $ttl = min( $parserOutput->getCacheExpiry() - $since, self::MAX_CACHE_TTL ); + + // Avoid extremely stale user signature timestamps (T84843) + if ( $parserOutput->getFlag( 'user-signature' ) ) { + $ttl = min( $ttl, self::MAX_SIGNATURE_TTL ); + } + if ( $ttl <= 0 ) { return [ null, 0, 'no_ttl' ]; }