Skip to content

Commit 8c0aa95

Browse files
committed
use base64 for delete_message.php
1 parent a4cedfb commit 8c0aa95

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

resources/templates/header.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
use UnityWebPortal\lib\UnityHTTPD;
44

55
if ($_SERVER["REQUEST_METHOD"] == "POST") {
6+
$x = 5 / 0;
67
// another page should have already validated and we can't validate the same token twice
78
// UnityHTTPD::validatePostCSRFToken();
89
if (
@@ -164,9 +165,9 @@
164165
htmlspecialchars($level->value),
165166
htmlspecialchars($title),
166167
htmlspecialchars($body),
167-
htmlspecialchars($level->value),
168-
htmlspecialchars($title),
169-
htmlspecialchars($body),
168+
base64_encode($level->value),
169+
base64_encode($title),
170+
base64_encode($body),
170171
);
171172
}
172173
if (

webroot/panel/ajax/delete_message.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
use UnityWebPortal\lib\UnityHTTPD;
66
use UnityWebPortal\lib\UnityHTTPDMessageLevel;
77

8-
$level_str = UnityHTTPD::getPostData("level");
8+
$level_str = base64_decode(UnityHTTPD::getPostData("level"));
99
$level = UnityHTTPDMessageLevel::from($level_str);
10-
$title = UnityHTTPD::getPostData("title");
11-
$body = UnityHTTPD::getPostData("body");
10+
$title = base64_decode(UnityHTTPD::getPostData("title"));
11+
$body = base64_decode(UnityHTTPD::getPostData("body"));
1212
UnityHTTPD::deleteMessage($level, $title, $body);

0 commit comments

Comments
 (0)