From 3c87c79679dd5ab3c9d0914f721271759a9a49ab Mon Sep 17 00:00:00 2001
From: SQKo <87897282+SQKo@users.noreply.github.com>
Date: Sat, 3 Jun 2023 13:59:15 +0700
Subject: [PATCH] move webpage_content to separate file
---
src/TOTK/webapi.php | 260 +-----------------------------------
src/TOTK/webapi_content.php | 260 ++++++++++++++++++++++++++++++++++++
2 files changed, 263 insertions(+), 257 deletions(-)
create mode 100644 src/TOTK/webapi_content.php
diff --git a/src/TOTK/webapi.php b/src/TOTK/webapi.php
index d73d2e5..9d98e17 100644
--- a/src/TOTK/webapi.php
+++ b/src/TOTK/webapi.php
@@ -66,263 +66,9 @@ function webapiSnow($string) {
if (! $whitelisted) $TOTK->logger->info('API REMOTE_ADDR ' . $request->getServerParams()['REMOTE_ADDR']);
$webpage_content = function ($return) use ($TOTK, $port, $sub) {
- return '
-
-
-
-
-
-
-
-
- ' .
- str_replace('[' . date("Y"), '
[' . date("Y"),
- str_replace([PHP_EOL, '[] []', ' [] '], '
', $return)
- ) .
- "
-
-
-
-
-
-
- "
- . ($sub == 'botlog' ? "" : "")
- . "
-
-
-
-
-
-
-
- ";
+ ob_start();
+ include 'webapi_content.php';
+ return ob_get_clean();
};
switch ($sub) {
diff --git a/src/TOTK/webapi_content.php b/src/TOTK/webapi_content.php
new file mode 100644
index 0000000..9991913
--- /dev/null
+++ b/src/TOTK/webapi_content.php
@@ -0,0 +1,260 @@
+
+
+
+
+
+
+
+
+
+= str_replace('[' . date("Y"), '
[' . date("Y"),
+ str_replace([PHP_EOL, '[] []', ' [] '], '
', $return)
+ ); ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ >
+
+
+
+
+
\ No newline at end of file