Skip to content

Commit

Permalink
[5.x] Fix is_external_url modifier with Link fields (statamic#10027)
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanmcclean authored May 9, 2024
1 parent ea96781 commit c7c35e2
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 c7c35e2

Please sign in to comment.