Skip to content

Commit 22de3cc

Browse files
committed
refactoring: improve token validation in OEmbed class to ensure proper string handling
1 parent fc1a6c9 commit 22de3cc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Adapters/Facebook/OEmbed.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ protected function detectEndpoint(): ?UriInterface
1616
{
1717
$token = $this->extractor->getSetting('facebook:token');
1818

19-
if ($token === null || $token === '' || $token === false) {
19+
if (!is_string($token) || $token === '') {
2020
return null;
2121
}
2222

src/Adapters/Instagram/OEmbed.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ protected function detectEndpoint(): ?UriInterface
1414
{
1515
$token = $this->extractor->getSetting('instagram:token');
1616

17-
if ($token === null || $token === '' || $token === false) {
17+
if (!is_string($token) || $token === '') {
1818
return null;
1919
}
2020

0 commit comments

Comments
 (0)