[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

View file

@ -374,7 +374,7 @@ EOD;
$data = $cache->loadData(); $data = $cache->loadData();
$apiKey = null; $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'); $twitterPage = getContents('https://twitter.com');
$jsMainRegex = '/(https:\/\/abs\.twimg\.com\/responsive-web\/web_legacy\/main\.[^\.]+\.js)/m'; $jsMainRegex = '/(https:\/\/abs\.twimg\.com\/responsive-web\/web_legacy\/main\.[^\.]+\.js)/m';