Skip to content

Commit

Permalink
Ignore global functions like link
Browse files Browse the repository at this point in the history
  • Loading branch information
assertchris committed Oct 22, 2018
1 parent 50c37d0 commit 9f86467
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions source/Renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -565,16 +565,26 @@ class Renderer
"zoomandpan" => "zoomAndPan",
];

private $ignoredFunctions = [
"link",
];

public function render($name, $props = null)
{
$props = $this->propsFrom($props);

if ($function = globalFunctionMatching($name)) {
if (!in_array($name, $this->ignoredFunctions) && ($function = globalFunctionMatching($name))) {
return call_user_func($function, $props);
}

if ($class = globalClassMatching($name)) {
return (new $class($props))->render();
$instance = new $class($props);

if (is_callable($instance)) {
return $instance($props);
}

return $instance->render();
}

if (!in_array($name, $this->allowedTags)) {
Expand Down

0 comments on commit 9f86467

Please sign in to comment.