summaryrefslogtreecommitdiff
path: root/pages/rules.inc
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2023-02-08 22:42:21 +0100
committerMinteck <contact@minteck.org>2023-02-08 22:42:21 +0100
commit885a05be06d0b42835652208c729e5fded451c26 (patch)
treee848835a00bce1bf790b867535a2c1e83cbcbe2e /pages/rules.inc
parent5026c2f48d2a1bf8fbd3a63c1e41e59431054878 (diff)
downloadpluralconnect-885a05be06d0b42835652208c729e5fded451c26.tar.gz
pluralconnect-885a05be06d0b42835652208c729e5fded451c26.tar.bz2
pluralconnect-885a05be06d0b42835652208c729e5fded451c26.zip
Updated 9 files, added 2 files and deleted pages/bitset.inc (automated)
Diffstat (limited to 'pages/rules.inc')
-rw-r--r--pages/rules.inc10
1 files changed, 5 insertions, 5 deletions
diff --git a/pages/rules.inc b/pages/rules.inc
index bf156f2..7257cf1 100644
--- a/pages/rules.inc
+++ b/pages/rules.inc
@@ -29,7 +29,7 @@ if (isset($_POST["updateRules"])) {
$_POST["payload"][$index] = $rule;
}
- file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/rules/rules.json", utf8_encode(json_encode($_POST["payload"])));
+ file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/rules/rules.json", json_encode($_POST["payload"]));
header("Location: /-/rules");
die();
@@ -60,7 +60,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
<?php $index = 1; foreach ($rules as $rule): ?>
<h4 style="margin-top: 20px;">
- <b>Rule <?= $index ?>: <?= strip_tags($rule["name"]) ?></b>
+ <b>Rule <?= $index ?>: <?= str_replace("<", "&lt;", str_replace(">", "&gt;", $rule["name"])) ?></b>
<?php if (in_array(false, $rule["approved"])): ?>
<span class="badge bg-warning text-black rounded-pill">Unapproved</span>
<?php endif; ?>
@@ -103,7 +103,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
</div>
<?php endif; ?>
<div>
- <p><?= $Parsedown->text(strip_tags($rule["content"])) ?></p>
+ <p><?= $Parsedown->text(str_replace("<", "&lt;", str_replace(">", "&gt;", $rule["content"]))) ?></p>
</div>
</li>
<?php $index++; endforeach; ?>
@@ -132,9 +132,9 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
<?php $index = 1; foreach ($rules as $rule): ?>
<div <?= $index === 1 ? 'id="default-rule"' : '' ?>>
<p><b <?= $index === 1 ? 'id="default-rule--number"' : '' ?>>Rule #<?= $index ?>:</b></p>
- <input <?= $index === 1 ? 'id="default-rule--name"' : '' ?> type="text" placeholder="Rule name" class="form-control" style="margin-bottom:15px;color:white;background:#111;border-color:#222;" name="payload[<?= $index - 1 ?>][name]" value="<?= str_replace('"', "&quot;", strip_tags($rule["name"])) ?>">
+ <input <?= $index === 1 ? 'id="default-rule--name"' : '' ?> type="text" placeholder="Rule name" class="form-control" style="margin-bottom:15px;color:white;background:#111;border-color:#222;" name="payload[<?= $index - 1 ?>][name]" value="<?= str_replace('"', "&quot;", str_replace("<", "&lt;", str_replace(">", "&gt;", $rule["name"]))) ?>">
- <textarea <?= $index === 1 ? 'id="default-rule--content"' : '' ?> name="payload[<?= $index - 1 ?>][content]" rows="5" class="form-control" style="resize: none;color:white;background:#111;border-color:#222;" placeholder="Rule details"><?= strip_tags($rule["content"] ?? "") ?></textarea>
+ <textarea <?= $index === 1 ? 'id="default-rule--content"' : '' ?> name="payload[<?= $index - 1 ?>][content]" rows="5" class="form-control" style="resize: none;color:white;background:#111;border-color:#222;" placeholder="Rule details"><?= str_replace("<", "&lt;", str_replace(">", "&gt;", $rule["content"] ?? "")) ?></textarea>
<label style="margin-top:10px;margin-left:5px;">
<input <?= $index === 1 ? 'id="default-rule--approval-1"' : '' ?> <?= ($rule["approved"][0] ?? false) ? "checked" : "" ?> type="checkbox" class="form-check-input" name="payload[<?= $index - 1 ?>][approved][0]">