aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvincent-peugnet <v.peugnet@free.fr>2018-12-22 19:33:10 +0100
committervincent-peugnet <v.peugnet@free.fr>2018-12-22 19:33:10 +0100
commit532cdf4bb82ab7cc6fa7659d9aec3ce122b2ec52 (patch)
tree801e0385f82d4e7e7888a80da645ef511cb1379e
parent0e95eb5121b2f4be63591705c367a0de10046133 (diff)
downloadwcms-532cdf4bb82ab7cc6fa7659d9aec3ce122b2ec52.tar.gz
wcms-532cdf4bb82ab7cc6fa7659d9aec3ce122b2ec52.zip
bug fix : medi preg match
-rw-r--r--app/class/controllerart.php7
-rw-r--r--app/class/modelrender.php7
-rw-r--r--app/view/templates/edittopbar.php6
-rw-r--r--index.php2
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 @@
</span>
<span id="headid"><?= $art->id() ?></span>
-<span id="fontsize">
+ <span id="fontsize">
<label for="fontsize">Font-size</label>
- <input type="number" name="fontsize" value="<?= Config::fontsize() ?>" id="fontsize">
+ <input type="number" name="fontsize" value="<?= Config::fontsize() ?>" id="fontsize" min="5" max="99">
</span>
-<span id="menu">
+<span id="menu" style="display: none;">
<?php if($user->iseditor()) { ?>
<a href="<?= $this->url('font') ?>"><span class="symbol">📝</span><span class="text">font</span></a>
diff --git a/index.php b/index.php
index 7c9cb31..65b4271 100644
--- a/index.php
+++ b/index.php
@@ -21,7 +21,7 @@ try {
$matchoper->match();
} catch (Exception $e) {
- echo 'Exception reçue : ', $e->getMessage(), "\n";
+ echo '⚠ ⚠ ⚠ Sorry, there is a little problem : ', '<i>'.$e->getMessage().'</i>', "\n";
}