mirror of
https://github.com/getgrav/grav.git
synced 2025-02-20 19:56:53 +01:00
deprecation fix
This commit is contained in:
parent
36afa9d848
commit
3cf67cb2fd
|
|
@ -13,6 +13,7 @@
|
|||
* Comment out `files-upload` deprecated message as this is not going to be removed
|
||||
* Added various public `Twig` class variables used by admin to address deprecated messages for PHP 8.2+
|
||||
* Added `parse_url` to list of PHP functions supported in Twig Extension
|
||||
* Added support for dynamic functions in `Parsedown` to stop deprecation messages in PHP 8.2+
|
||||
|
||||
# v1.7.40
|
||||
## 03/22/2023
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ trait ParsedownGravTrait
|
|||
public $completable_blocks = [];
|
||||
/** @var array */
|
||||
public $continuable_blocks = [];
|
||||
|
||||
public $plugins = [];
|
||||
|
||||
/** @var Excerpts */
|
||||
protected $excerpts;
|
||||
|
|
@ -293,7 +293,12 @@ trait ParsedownGravTrait
|
|||
#[\ReturnTypeWillChange]
|
||||
public function __call($method, $args)
|
||||
{
|
||||
if (isset($this->{$method}) === true) {
|
||||
|
||||
if (isset($this->plugins[$method]) === true) {
|
||||
$func = $this->plugins[$method];
|
||||
|
||||
return call_user_func_array($func, $args);
|
||||
} elseif (isset($this->{$method}) === true) {
|
||||
$func = $this->{$method};
|
||||
|
||||
return call_user_func_array($func, $args);
|
||||
|
|
@ -302,5 +307,13 @@ trait ParsedownGravTrait
|
|||
return null;
|
||||
}
|
||||
|
||||
public function __set($name, $value)
|
||||
{
|
||||
if (is_callable($value)) {
|
||||
$this->plugins[$name] = $value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user