Skip to content

registerPlugin should fix Exception #1106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
starline opened this issue Feb 27, 2025 · 1 comment
Open

registerPlugin should fix Exception #1106

starline opened this issue Feb 27, 2025 · 1 comment

Comments

@starline
Copy link

in vendor/smarty/smarty/src/Smarty.php class_exists (line 752)

* @api Smarty::registerPlugin() */ public function registerPlugin($type, $name, $callback, $cacheable = true) { if (isset($this->registered_plugins[$type][$name])) { throw new Exception("Plugin tag '{$name}' already registered"); } elseif (!is_callable($callback) && !class_exists($callback)) { throw new Exception("Plugin '{$name}' not callable"); } else { $this->registered_plugins[$type][$name] = [$callback, (bool)$cacheable]; } return $this;

HTTP 500 Internal Server Error:
class_exists(): Argument #1 ($class) must be of type string, array given

@starline
Copy link
Author

starline commented Feb 27, 2025

How to catch

use:
$this->smarty->registerPlugin(Smarty::PLUGIN_MODIFIER, $name, [$instance, $function_name]);
and function doesn't exist

I expect to get an exception. but I've gotten the error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant