Skip to content

Commit fc1a6c9

Browse files
committed
fix: enhance owner and username checks to prevent empty string handling in AuthorUrl
1 parent a386551 commit fc1a6c9

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/Adapters/Gist/Detectors/AuthorUrl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public function detect(): ?UriInterface
1616
$api = $extractor->getApi();
1717
$owner = $api->str('owner');
1818

19-
if ($owner !== null) {
19+
if ($owner !== null && $owner !== '') {
2020
return $extractor->getCrawler()->createUri("https://github.com/{$owner}");
2121
}
2222

src/Adapters/ImageShack/Detectors/AuthorUrl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public function detect(): ?UriInterface
1616
$api = $extractor->getApi();
1717
$owner = $api->str('owner', 'username');
1818

19-
if ($owner !== null) {
19+
if ($owner !== null && $owner !== '') {
2020
return $extractor->getCrawler()->createUri("https://imageshack.com/{$owner}");
2121
}
2222

src/Adapters/Twitter/Detectors/AuthorUrl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public function detect(): ?UriInterface
1616
$api = $extractor->getApi();
1717
$username = $api->str('includes', 'users', '0', 'username');
1818

19-
if ($username !== null) {
19+
if ($username !== null && $username !== '') {
2020
return $extractor->getCrawler()->createUri("https://twitter.com/{$username}");
2121
}
2222

0 commit comments

Comments
 (0)