Version 4.3.6
This commit is contained in:
1 parent
fe1acf984a
commit
1a0c7fd3c2
609 files changed
+14707
-5726
No files matched your search
@@ -45,22 +45,29 @@ class _SandboxedTemplate
|
||||
*/
|
||||
public function __call( $name, $args )
|
||||
{
|
||||
if ( !method_exists( $this->template, $name ) )
|
||||
try
|
||||
{
|
||||
return "<span style='background:black;color:white;padding:6px;'>[[Template {$this->template->app}/{$this->template->templateLocation}/{$this->template->templateName}/{$name} does not exist. This theme may be out of date. Run the support tool in the AdminCP to restore the default theme.]]</span>";
|
||||
if ( !method_exists( $this->template, $name ) )
|
||||
{
|
||||
return "<span style='background:black;color:white;padding:6px;'>[[Template {$this->template->app}/{$this->template->templateLocation}/{$this->template->templateName}/{$name} does not exist. This theme may be out of date. Run the support tool in the AdminCP to restore the default theme.]]</span>";
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
return $this->template->$name( ...$args );
|
||||
}
|
||||
catch ( \ErrorException $e )
|
||||
{
|
||||
throw new \Error( $e );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
catch( \Throwable $e )
|
||||
{
|
||||
try
|
||||
{
|
||||
return $this->template->$name( ...$args );
|
||||
}
|
||||
catch ( \ErrorException $e )
|
||||
{
|
||||
\IPS\Log::log( $e, 'template_error' );
|
||||
|
||||
return "<span style='background:black;color:white;padding:6px;'>[[Template {$this->template->app}/{$this->template->templateLocation}/{$this->template->templateName}/{$name} is throwing an error. This theme may be out of date. Run the support tool in the AdminCP to restore the default theme.]]</span>";
|
||||
}
|
||||
\IPS\Log::log( $e, 'template_error' );
|
||||
|
||||
return "<span style='background:black;color:white;padding:6px;'>[[Template {$this->template->app}/{$this->template->templateLocation}/{$this->template->templateName}/{$name} is throwing an error. This theme may be out of date. Run the support tool in the AdminCP to restore the default theme.]]</span>";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user