about summary refs log tree commit diff stats
path: root/classes
diff options
context:
space:
mode:
authorAndrew Dolgov <fox@fakecake.org>2026-05-24 21:11:15 +0300
committerAndrew Dolgov <fox@fakecake.org>2026-05-24 21:11:15 +0300
commitce40334f1a4708958b38c8565635019e4fbeefb9 (patch)
tree1111c4ce4483f543a3bd3729228d8e04e2ad24ce /classes
parent76b2eb6f191c535a428ee71c74c406dc9d206d9e (diff)
downloadthe-epube-ce40334f1a4708958b38c8565635019e4fbeefb9.tar.gz
the-epube-ce40334f1a4708958b38c8565635019e4fbeefb9.tar.xz
remove inline event handlers, bring back html book descriptions
Diffstat (limited to 'classes')
-rw-r--r--classes/CsrfMiddleware.php2
-rw-r--r--classes/Handler/GetinfoHandler.php3
2 files changed, 4 insertions, 1 deletions
diff --git a/classes/CsrfMiddleware.php b/classes/CsrfMiddleware.php
index 8510766..2361957 100644
--- a/classes/CsrfMiddleware.php
+++ b/classes/CsrfMiddleware.php
@@ -4,7 +4,7 @@ class CsrfMiddleware implements MiddlewareInterface
 {
     /** @var array<string> */
     private array $csrfIgnore = [
-        "cover", "download", "getpagination", "getlastread"
+        "cover", "download", "getpagination", "getlastread", "getinfo"
     ];
 
     public function process(Request $request, callable $next): Response
diff --git a/classes/Handler/GetinfoHandler.php b/classes/Handler/GetinfoHandler.php
index e599671..86772ff 100644
--- a/classes/Handler/GetinfoHandler.php
+++ b/classes/Handler/GetinfoHandler.php
@@ -7,6 +7,7 @@ use Request;
 use RequestHandlerInterface;
 use Response;
 use PDO;
+use Sanitizer;
 
 class GetinfoHandler implements RequestHandlerInterface
 {
@@ -24,6 +25,8 @@ class GetinfoHandler implements RequestHandlerInterface
         $sth->execute([$id]);
 
         if ($row = $sth->fetch()) {
+			$row['comment'] = Sanitizer::sanitize($row['comment'] ?? "");
+
             return (new Response())->withBody(json_encode($row));
         }