mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 17:58:41 +00:00
tpl fixes, dont use printHtml for none-string types
This commit is contained in:
parent
f5ad4345bb
commit
4b1d77cc86
|
|
@ -81,29 +81,29 @@ abstract class ViewAbstract implements RenderableInterface
|
|||
/**
|
||||
* Print html output.
|
||||
*
|
||||
* @param string $text Text
|
||||
* @param ?string $text Text
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function printHtml(string $text) : string
|
||||
public function printHtml(?string $text) : string
|
||||
{
|
||||
return \htmlspecialchars($text);
|
||||
return $text === null ? '' : \htmlspecialchars($text);
|
||||
}
|
||||
|
||||
/**
|
||||
* Print html output.
|
||||
*
|
||||
* @param string $text Text
|
||||
* @param ?string $text Text
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public static function html(string $text) : string
|
||||
public static function html(?string $text) : string
|
||||
{
|
||||
return \htmlspecialchars($text);
|
||||
return $text === null ? '' : \htmlspecialchars($text);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -247,6 +247,7 @@ abstract class ViewAbstract implements RenderableInterface
|
|||
} catch (\Throwable $e) {
|
||||
\ob_end_clean();
|
||||
$ob = '';
|
||||
echo $e->getMessage();
|
||||
} finally {
|
||||
return $ob;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user