From b0fec2951aeffaff9df8ab082c20331e0d3acfe8 Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Wed, 5 Oct 2022 15:05:36 +0200 Subject: [PATCH] Ajouter un slash devant le namespace de la classe strftime --- core/core.php | 6 +++--- core/module/addon/addon.php | 12 ++++++------ core/module/config/config.php | 6 +++--- core/module/user/user.php | 6 +++--- module/blog/blog.php | 18 +++++++++--------- module/blog/view/article/article.php | 18 +++++++++--------- module/blog/view/index/index.php | 6 +++--- module/news/news.php | 24 ++++++++++++------------ module/news/view/article/article.php | 12 ++++++------ module/news/view/index/index.php | 6 +++--- 10 files changed, 57 insertions(+), 57 deletions(-) diff --git a/core/core.php b/core/core.php index beaa6221..e36fcfdd 100644 --- a/core/core.php +++ b/core/core.php @@ -2711,9 +2711,9 @@ class core extends common exit(); } // Journalisation - $dataLog = mb_detect_encoding(PHP81_BC\strftime('%d/%m/%y', time()), 'UTF-8', true) - ? PHP81_BC\strftime('%d/%m/%y', time()) . ';' . PHP81_BC\strftime('%R', time()) . ';' - : utf8_encode(PHP81_BC\strftime('%d/%m/%y', time())) . ';' . utf8_encode(PHP81_BC\strftime('%R', time())) . ';'; + $dataLog = mb_detect_encoding(\PHP81_BC\strftime('%d/%m/%y', time()), 'UTF-8', true) + ? \PHP81_BC\strftime('%d/%m/%y', time()) . ';' . \PHP81_BC\strftime('%R', time()) . ';' + : utf8_encode(\PHP81_BC\strftime('%d/%m/%y', time())) . ';' . utf8_encode(\PHP81_BC\strftime('%R', time())) . ';'; $dataLog .= helper::getIp($this->getData(['config', 'connect', 'anonymousIp'])) . ';'; $dataLog .= $this->getUser('id') ? $this->getUser('id') . ';' : 'anonyme' . ';'; $dataLog .= $this->getUrl(); diff --git a/core/module/addon/addon.php b/core/module/addon/addon.php index 52d86f44..1eb36da0 100644 --- a/core/module/addon/addon.php +++ b/core/module/addon/addon.php @@ -316,9 +316,9 @@ class addon extends common { $store[$key]['category'], ''.$store[$key]['title'].'', $store[$key]['version'], - mb_detect_encoding(PHP81_BC\strftime('%d %B %Y', $store[$key]['versionDate']), 'UTF-8', true) - ? PHP81_BC\strftime('%d %B %Y', $store[$key]['versionDate']) - : utf8_encode(PHP81_BC\strftime('%d %B %Y', $store[$key]['versionDate'])), + mb_detect_encoding(\PHP81_BC\strftime('%d %B %Y', $store[$key]['versionDate']), 'UTF-8', true) + ? \PHP81_BC\strftime('%d %B %Y', $store[$key]['versionDate']) + : utf8_encode(\PHP81_BC\strftime('%d %B %Y', $store[$key]['versionDate'])), implode(', ', array_keys($inPagesTitle,$key)), template::button('moduleExport' . $key, [ 'class' => $class, @@ -342,9 +342,9 @@ class addon extends common { public function item() { $store = json_decode(helper::getUrlContents(self::BASEURL_STORE . self::MODULE_STORE . 'list'), true); self::$storeItem = $store [$this->getUrl(2)] ; - self::$storeItem ['fileDate'] = mb_detect_encoding(PHP81_BC\strftime('%d %B %Y',self::$storeItem ['fileDate']), 'UTF-8', true) - ? PHP81_BC\strftime('%d %B %Y', self::$storeItem ['fileDate']) - : utf8_encode(PHP81_BC\strftime('%d %B %Y', self::$storeItem ['fileDate'])); + self::$storeItem ['fileDate'] = mb_detect_encoding(\PHP81_BC\strftime('%d %B %Y',self::$storeItem ['fileDate']), 'UTF-8', true) + ? \PHP81_BC\strftime('%d %B %Y', self::$storeItem ['fileDate']) + : utf8_encode(\PHP81_BC\strftime('%d %B %Y', self::$storeItem ['fileDate'])); // Valeurs en sortie $this->addOutput([ 'title' =>'Module ' . self::$storeItem['title'], diff --git a/core/module/config/config.php b/core/module/config/config.php index 2b80743a..36fce3e1 100644 --- a/core/module/config/config.php +++ b/core/module/config/config.php @@ -734,9 +734,9 @@ class config extends common { $d = $this->getData(['blacklist']); $data = ''; foreach ($d as $key => $item) { - $data .= mb_detect_encoding(PHP81_BC\strftime('%d/%m/%y',$item['lastFail']), 'UTF-8', true) - ? PHP81_BC\strftime('%d/%m/%y',$item['lastFail']) . ';' . utf8_encode(PHP81_BC\strftime('%R',$item['lastFail'])) . ';' - : utf8_encode(PHP81_BC\strftime('%d/%m/%y',$item['lastFail'])) . ';' . utf8_encode(PHP81_BC\strftime('%R',$item['lastFail'])) . ';' ; + $data .= mb_detect_encoding(\PHP81_BC\strftime('%d/%m/%y',$item['lastFail']), 'UTF-8', true) + ? \PHP81_BC\strftime('%d/%m/%y',$item['lastFail']) . ';' . utf8_encode(\PHP81_BC\strftime('%R',$item['lastFail'])) . ';' + : utf8_encode(\PHP81_BC\strftime('%d/%m/%y',$item['lastFail'])) . ';' . utf8_encode(\PHP81_BC\strftime('%R',$item['lastFail'])) . ';' ; $data .= $key . ';' . $item['ip'] . ';' . $item['connectFail'] . PHP_EOL; } file_put_contents($fileName,$data,FILE_APPEND); diff --git a/core/module/user/user.php b/core/module/user/user.php index 274d8d75..bebd915e 100644 --- a/core/module/user/user.php +++ b/core/module/user/user.php @@ -487,9 +487,9 @@ class user extends common { } } // Journalisation - $dataLog = mb_detect_encoding(PHP81_BC\strftime('%d/%m/%y',time()), 'UTF-8', true) - ? PHP81_BC\strftime('%d/%m/%y',time()) . ';' . PHP81_BC\strftime('%R',time()) . ';' - : utf8_encode(PHP81_BC\strftime('%d/%m/%y',time())) . ';' . utf8_encode(PHP81_BC\strftime('%R',time())) . ';' ; + $dataLog = mb_detect_encoding(\PHP81_BC\strftime('%d/%m/%y',time()), 'UTF-8', true) + ? \PHP81_BC\strftime('%d/%m/%y',time()) . ';' . \PHP81_BC\strftime('%R',time()) . ';' + : utf8_encode(\PHP81_BC\strftime('%d/%m/%y',time())) . ';' . utf8_encode(\PHP81_BC\strftime('%R',time())) . ';' ; $dataLog .= helper::getIp($this->getData(['config','connect','anonymousIp'])) . ';'; $dataLog .= is_null($this->getInput('userLoginId')) ? ';' : $this->getInput('userLoginId', helper::FILTER_ID) . ';' ; $dataLog .= $this->getUrl() .';' ; diff --git a/module/blog/blog.php b/module/blog/blog.php index 8e7a4ebb..1c7d0fa7 100644 --- a/module/blog/blog.php +++ b/module/blog/blog.php @@ -279,9 +279,9 @@ class blog extends common { ]); } self::$comments[] = [ - mb_detect_encoding(PHP81_BC\strftime('%d %B %Y - %H:%M', $comment['createdOn']), 'UTF-8', true) - ? PHP81_BC\strftime('%d %B %Y - %H:%M', $comment['createdOn']) - : utf8_encode(PHP81_BC\strftime('%d %B %Y - %H:%M', $comment['createdOn'])), + mb_detect_encoding(\PHP81_BC\strftime('%d %B %Y - %H:%M', $comment['createdOn']), 'UTF-8', true) + ? \PHP81_BC\strftime('%d %B %Y - %H:%M', $comment['createdOn']) + : utf8_encode(\PHP81_BC\strftime('%d %B %Y - %H:%M', $comment['createdOn'])), $comment['content'], $comment['userId'] ? $this->getData(['user', $comment['userId'], 'firstname']) . ' ' . $this->getData(['user', $comment['userId'], 'lastname']) : $comment['author'], $buttonApproval, @@ -457,12 +457,12 @@ class blog extends common { $approved = count($this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i],'comment'])); } // Met en forme le tableau - $date = mb_detect_encoding(PHP81_BC\strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn'])), 'UTF-8', true) - ? PHP81_BC\strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn'])) - : utf8_encode(PHP81_BC\strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn']))); - $heure = mb_detect_encoding(PHP81_BC\strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn'])), 'UTF-8', true) - ? PHP81_BC\strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn'])) - : utf8_encode(PHP81_BC\strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn']))); + $date = mb_detect_encoding(\PHP81_BC\strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn'])), 'UTF-8', true) + ? \PHP81_BC\strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn'])) + : utf8_encode(\PHP81_BC\strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn']))); + $heure = mb_detect_encoding(\PHP81_BC\strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn'])), 'UTF-8', true) + ? \PHP81_BC\strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn'])) + : utf8_encode(\PHP81_BC\strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn']))); self::$articles[] = [ '' . $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'title']) . diff --git a/module/blog/view/article/article.php b/module/blog/view/article/article.php index 6d31ef38..0992aa6f 100644 --- a/module/blog/view/article/article.php +++ b/module/blog/view/article/article.php @@ -14,12 +14,12 @@ - getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])), 'UTF-8', true) - ? PHP81_BC\strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])) - : utf8_encode(PHP81_BC\strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']))); - $heure = mb_detect_encoding(PHP81_BC\strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])), 'UTF-8', true) - ? PHP81_BC\strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])) - : utf8_encode(PHP81_BC\strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']))); + getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])), 'UTF-8', true) + ? \PHP81_BC\strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])) + : utf8_encode(\PHP81_BC\strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']))); + $heure = mb_detect_encoding(\PHP81_BC\strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])), 'UTF-8', true) + ? \PHP81_BC\strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])) + : utf8_encode(\PHP81_BC\strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']))); echo $date . ' à ' . $heure; ?> @@ -143,9 +143,9 @@ $comment): ?>

- le

diff --git a/module/blog/view/index/index.php b/module/blog/view/index/index.php index 71c81296..292182d4 100644 --- a/module/blog/view/index/index.php +++ b/module/blog/view/index/index.php @@ -36,9 +36,9 @@
- +

'), 0, 400); ?>... diff --git a/module/news/news.php b/module/news/news.php index 87f6053e..2619ca03 100644 --- a/module/news/news.php +++ b/module/news/news.php @@ -240,21 +240,21 @@ class news extends common { // News en fonction de la pagination for($i = $pagination['first']; $i < $pagination['last']; $i++) { // Met en forme le tableau - $dateOn = mb_detect_encoding(PHP81_BC\strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn'])), 'UTF-8', true) - ? PHP81_BC\strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn'])) - : utf8_encode(PHP81_BC\strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn']))); + $dateOn = mb_detect_encoding(\PHP81_BC\strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn'])), 'UTF-8', true) + ? \PHP81_BC\strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn'])) + : utf8_encode(\PHP81_BC\strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn']))); $dateOn .= ' à '; - $dateOn .= mb_detect_encoding(PHP81_BC\strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn'])), 'UTF-8', true) - ? PHP81_BC\strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn'])) - : utf8_encode(PHP81_BC\strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn']))); + $dateOn .= mb_detect_encoding(\PHP81_BC\strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn'])), 'UTF-8', true) + ? \PHP81_BC\strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn'])) + : utf8_encode(\PHP81_BC\strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn']))); if ($this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff'])) { - $dateOff = mb_detect_encoding(PHP81_BC\strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff'])), 'UTF-8', true) - ? PHP81_BC\strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff'])) - : utf8_encode(PHP81_BC\strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff']))); + $dateOff = mb_detect_encoding(\PHP81_BC\strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff'])), 'UTF-8', true) + ? \PHP81_BC\strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff'])) + : utf8_encode(\PHP81_BC\strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff']))); $dateOff .= ' à '; - $dateOff .= mb_detect_encoding(PHP81_BC\strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff'])), 'UTF-8', true) - ? PHP81_BC\strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff'])) - : utf8_encode(PHP81_BC\strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff']))); + $dateOff .= mb_detect_encoding(\PHP81_BC\strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff'])), 'UTF-8', true) + ? \PHP81_BC\strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff'])) + : utf8_encode(\PHP81_BC\strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff']))); } else { $dateOff = 'Permanent'; } diff --git a/module/news/view/article/article.php b/module/news/view/article/article.php index 230e27d4..03f9abc3 100644 --- a/module/news/view/article/article.php +++ b/module/news/view/article/article.php @@ -8,12 +8,12 @@ - getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])), 'UTF-8', true) - ? PHP81_BC\strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])) - : utf8_encode(PHP81_BC\strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']))); - $heure = mb_detect_encoding(PHP81_BC\strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])), 'UTF-8', true) - ? PHP81_BC\strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])) - : utf8_encode(PHP81_BC\strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']))); + getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])), 'UTF-8', true) + ? \PHP81_BC\strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])) + : utf8_encode(\PHP81_BC\strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']))); + $heure = mb_detect_encoding(\PHP81_BC\strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])), 'UTF-8', true) + ? \PHP81_BC\strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])) + : utf8_encode(\PHP81_BC\strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']))); echo $date . ' à ' . $heure; ?> diff --git a/module/news/view/index/index.php b/module/news/view/index/index.php index 0145350e..311d8268 100644 --- a/module/news/view/index/index.php +++ b/module/news/view/index/index.php @@ -14,9 +14,9 @@

- + -