Skip to content

Commit

Permalink
FIX Don't use call_user_func_array in __call() (#3034)
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli authored Dec 3, 2024
1 parent 9ace9be commit 9b97b5f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions code/Model/VirtualPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -483,10 +483,11 @@ public function isFieldVirtualised($field)
*/
public function __call($method, $args)
{
if (parent::hasMethod($method)) {
if (parent::hasMethod($method) || !$this->CopyContentFromID) {
return parent::__call($method, $args);
} else {
return call_user_func_array([$this->CopyContentFrom(), $method], $args ?? []);
$record = $this->CopyContentFrom();
return $record->$method(...$args);
}
}

Expand Down

0 comments on commit 9b97b5f

Please sign in to comment.