From 88b2dd53a53c611c27b74c8bee092724542c5c9f Mon Sep 17 00:00:00 2001 From: ghost Date: Thu, 30 Dec 2021 07:51:39 +0200 Subject: [PATCH] rename localization helper to format, add posts br support --- src/application/controller/api/post/get.php | 8 ++++---- src/bootstrap.php | 2 +- src/system/helper/{localization.php => format.php} | 11 ++++++++--- 3 files changed, 13 insertions(+), 8 deletions(-) rename src/system/helper/{localization.php => format.php} (91%) diff --git a/src/application/controller/api/post/get.php b/src/application/controller/api/post/get.php index 16ab822..b2790e9 100644 --- a/src/application/controller/api/post/get.php +++ b/src/application/controller/api/post/get.php @@ -43,16 +43,16 @@ if (isset($_SESSION['userName'])) { } $reTwist = [ - 'message' => implode('', $reTwists), - 'time' => Localization::time($post['userpost']['rt']['time']), + 'message' => Format::post(implode('', $reTwists)), + 'time' => Format::time($post['userpost']['rt']['time']), 'userName' => $post['userpost']['rt']['n'], 'reTwist' => $reTwist, ]; } $posts[] = [ - 'message' => implode('', $messages), - 'time' => Localization::time($post['userpost']['time']), + 'message' => Format::post(implode('', $messages)), + 'time' => Format::time($post['userpost']['time']), 'userName' => $post['userpost']['n'], 'reTwist' => $reTwist, ]; diff --git a/src/bootstrap.php b/src/bootstrap.php index d45674b..d5073a7 100644 --- a/src/bootstrap.php +++ b/src/bootstrap.php @@ -12,7 +12,7 @@ require(PROJECT_DIR . '/system/twister.php'); require(PROJECT_DIR . '/system/icon.php'); require(PROJECT_DIR . '/system/helper/filter.php'); require(PROJECT_DIR . '/system/helper/valid.php'); -require(PROJECT_DIR . '/system/helper/localization.php'); +require(PROJECT_DIR . '/system/helper/format.php'); // Init libraries $_twister = new Twister( diff --git a/src/system/helper/localization.php b/src/system/helper/format.php similarity index 91% rename from src/system/helper/localization.php rename to src/system/helper/format.php index f9ca812..f87c630 100644 --- a/src/system/helper/localization.php +++ b/src/system/helper/format.php @@ -1,6 +1,6 @@