[TwitterBridge] apikey fetched every time (#1663)

The apikey is fetched every time because $data is not an array. Update the condition to expire the api key at the same time as the guest token.
This commit is contained in:
triatic 2020-07-30 05:54:16 +01:00 committed by GitHub
parent a33088ca99
commit f5916a2f74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -374,7 +374,7 @@ EOD;
$data = $cache->loadData();
$apiKey = null;
if($data === null || !is_array($data) || count($data) != 1) {
if($data === null || (time() - $refresh) > self::GUEST_TOKEN_EXPIRY) {
$twitterPage = getContents('https://twitter.com');
$jsMainRegex = '/(https:\/\/abs\.twimg\.com\/responsive-web\/web_legacy\/main\.[^\.]+\.js)/m';