Skip to content
Snippets Groups Projects
Commit 3b05e9f2 authored by Kev's avatar Kev :dog:
Browse files

Fix callable string calls global function

This fixes a bug where a value, such as `exec`, is technically callable
but we don’t expect it to be actually callable as it’s likely to be a
value of a model.
parent 9ea98538
No related branches found
No related tags found
No related merge requests found
Pipeline #625821862 passed
...@@ -40,7 +40,7 @@ abstract class Entity implements Arrayable ...@@ -40,7 +40,7 @@ abstract class Entity implements Arrayable
$value = $this->object->{$name}; $value = $this->object->{$name};
} }
$value = is_callable($value) ? $value() : $value; $value = !is_string($value) && is_callable($value) ? $value() : $value;
$this->exposes[$name] = $value; $this->exposes[$name] = $value;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment