mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-09 21:48:41 +00:00
Fix serialization
This commit is contained in:
parent
62628c40b5
commit
8c4c6bf03c
|
|
@ -324,7 +324,7 @@ class View implements \Serializable
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||||
*/
|
*/
|
||||||
public function getText(string $translation, string $module = null, string $theme = null)
|
private function getText(string $translation, string $module = null, string $theme = null)
|
||||||
{
|
{
|
||||||
if (!isset($module)) {
|
if (!isset($module)) {
|
||||||
$match = '/Modules/';
|
$match = '/Modules/';
|
||||||
|
|
@ -407,13 +407,19 @@ class View implements \Serializable
|
||||||
/**
|
/**
|
||||||
* Serialize view for rendering.
|
* Serialize view for rendering.
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string|array
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||||
*/
|
*/
|
||||||
public function serialize()
|
public function serialize()
|
||||||
{
|
{
|
||||||
|
$path = realpath($oldPath = __DIR__ . '/../..' . $this->template . '.tpl.php');
|
||||||
|
|
||||||
|
if ($path === false || StringUtils::startsWith($path, ROOT_PATH) === false) {
|
||||||
|
return $this->toArray();
|
||||||
|
}
|
||||||
|
|
||||||
return $this->render();
|
return $this->render();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user