From 476198849024d9dd0601b29cd34ddab38ff755a2 Mon Sep 17 00:00:00 2001 From: vincent-peugnet Date: Tue, 9 Jul 2019 11:46:21 +0200 Subject: fix open media tag error --- app/class/config.php | 9 +++++++++ app/class/modelrender.php | 4 ++-- composer.json | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/app/class/config.php b/app/class/config.php index 75081f4..b3ef40c 100644 --- a/app/class/config.php +++ b/app/class/config.php @@ -93,6 +93,15 @@ abstract class Config return (self::$domain === $_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['HTTP_HOST']); } + /** + * Generate full url adress where W is installed + * @return string url adress finished by a slash "/" + */ + public static function url() : string + { + return self::$domain . (!empty(self::$basepath) ? '/' . self::$basepath : "") . '/'; + } + // ________________________________________ G E T _______________________________________ public static function arttable() diff --git a/app/class/modelrender.php b/app/class/modelrender.php index 8957559..914ca93 100644 --- a/app/class/modelrender.php +++ b/app/class/modelrender.php @@ -203,7 +203,7 @@ class Modelrender extends Modelart $head .= '' . PHP_EOL; $head .= '' . PHP_EOL; $head .= '' . PHP_EOL; - $head .= '' . PHP_EOL; + $head .= '' . PHP_EOL; foreach ($this->art->externalcss() as $externalcss) { @@ -562,7 +562,7 @@ class Modelrender extends Modelart */ public function everylink(string $text, int $limit) : string { - $regex = '~([\w-_éêèùïüîçà]{' . $limit . ',})~'; + $regex = '~([\w-_éêèùïüîçà]{' . $limit . ',})(?![^<]*>|[^<>]*<\/)~'; $text = preg_replace_callback($regex , function ($matches) { return '' . $matches[1] . ''; }, $text); diff --git a/composer.json b/composer.json index 93abe2c..a0e88dc 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "w-cms", "description": "point'n think", - "version": "1.2.3", + "version": "1.2.4", "require": { "michelf/php-markdown": "^1.8", "league/plates": "3.*", -- cgit v1.2.3