From 532cdf4bb82ab7cc6fa7659d9aec3ce122b2ec52 Mon Sep 17 00:00:00 2001 From: vincent-peugnet Date: Sat, 22 Dec 2018 19:33:10 +0100 Subject: bug fix : medi preg match --- app/class/controllerart.php | 7 +++++++ app/class/modelrender.php | 7 ++++--- app/view/templates/edittopbar.php | 6 +++--- index.php | 2 +- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/app/class/controllerart.php b/app/class/controllerart.php index 8511243..7bc8c23 100644 --- a/app/class/controllerart.php +++ b/app/class/controllerart.php @@ -202,6 +202,13 @@ class Controllerart extends Controller $_SESSION['workspace']['showrightpanel'] = isset($_POST['workspace']['showrightpanel']); $_SESSION['workspace']['showleftpanel'] = isset($_POST['workspace']['showleftpanel']); + if(!empty($_POST['fontsize']) && $_POST['fontsize'] !== Config::fontsize()) { + Config::setfontsize($_POST['fontsize']); + Config::savejson(); + } + + + $date = new DateTimeImmutable($_POST['pdate'] . $_POST['ptime'], new DateTimeZone('Europe/Paris')); $date = ['date' => $date]; diff --git a/app/class/modelrender.php b/app/class/modelrender.php index 8139d6d..7b7539c 100644 --- a/app/class/modelrender.php +++ b/app/class/modelrender.php @@ -198,7 +198,6 @@ class Modelrender extends Modelart public function parser(string $text) { - $text = $this->media($text); $text = $this->headerid($text); @@ -220,8 +219,10 @@ class Modelrender extends Modelart public function media(string $text): string { - $rend = $this; - $text = preg_replace('%(src|href)="((\/?[\w-_]+)+\.[a-z0-9]{1,5})"%', '$1="'.Model::mediapath() . '$2" target="_blank" class="media"', $text); + $text = preg_replace('%(src|href)="((\/?[\w-_]+)\.[a-z0-9]{1,5})"%', '$1="'.Model::mediapath() . '$2" target="_blank" class="media"', $text); + if(!is_string($text)) { + throw new Exception('Rendering error -> media module'); + } return $text; } diff --git a/app/view/templates/edittopbar.php b/app/view/templates/edittopbar.php index 5c1e43c..c547572 100644 --- a/app/view/templates/edittopbar.php +++ b/app/view/templates/edittopbar.php @@ -24,15 +24,15 @@ id() ?> - + - + - +