Skip to content

Commit

Permalink
Fix is_external_url modifier with Link fields
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanmcclean committed May 9, 2024
1 parent ea96781 commit 6fc3522
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Modifiers/CoreModifiers.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
use Statamic\Fields\Values;
use Statamic\Fieldtypes\Bard;
use Statamic\Fieldtypes\Bard\Augmentor;
use Statamic\Fieldtypes\Link\ArrayableLink;
use Statamic\Support\Arr;
use Statamic\Support\Dumper;
use Statamic\Support\Html;
Expand Down Expand Up @@ -1263,6 +1264,10 @@ public function isUrl($value)
*/
public function isExternalUrl($value)
{
if ($value instanceof ArrayableLink) {
$value = $value->value();
}

return Str::isUrl($value) && URL::isExternal($value);
}

Expand Down

0 comments on commit 6fc3522

Please sign in to comment.