diff --git a/ext/comment/theme.php b/ext/comment/theme.php
index d0e8abeaa..6c42b4b3d 100644
--- a/ext/comment/theme.php
+++ b/ext/comment/theme.php
@@ -190,7 +190,7 @@ public function display_all_user_comments(array $comments, int $page_number, int
$h_index = "Index";
$h_next = ($page_number >= $total_pages) ? "Next" : "Next";
- $page->set_title(html_escape($user->name)."'s comments");
+ $page->set_title("{$user->name}'s comments");
$page->add_block(new Block("Navigation", rawHTML($h_prev.' | '.$h_index.' | '.$h_next), "left", 0));
$this->display_paginator($page, "comment/beta-search/{$user->name}", null, $page_number, $total_pages);
}
diff --git a/ext/ext_manager/theme.php b/ext/ext_manager/theme.php
index 3dcfff171..07e07682d 100644
--- a/ext/ext_manager/theme.php
+++ b/ext/ext_manager/theme.php
@@ -151,8 +151,8 @@ public function display_doc(Page $page, ExtensionInfo $info): void
P(A(["href" => make_link("ext_manager")], "Back to the list"))
);
- $page->set_title("Documentation for " . html_escape($info->name));
- $page->set_heading(html_escape($info->name));
+ $page->set_title("Documentation for {$info->name}");
+ $page->set_heading($info->name);
$page->add_block(new NavBlock());
$page->add_block(new Block("Documentation", $html));
}
diff --git a/ext/forum/theme.php b/ext/forum/theme.php
index 3fc363075..bf0048e15 100644
--- a/ext/forum/theme.php
+++ b/ext/forum/theme.php
@@ -74,7 +74,7 @@ public function display_new_thread_composer(Page $page, ?string $threadText = nu
);
$blockTitle = "Write a new thread";
- $page->set_title(html_escape($blockTitle));
+ $page->set_title($blockTitle);
$page->add_block(new Block($blockTitle, $html, "main", 120));
}
@@ -156,7 +156,7 @@ public function display_thread(array $posts, bool $showAdminOptions, string $thr
DIV(["class" => "postDate"], SMALL(rawHTML(autodate($post['date'])))),
DIV(["class" => "postNumber"], " #".$post_number),
BR(),
- DIV(["class" => "postMessage"], rawHTML(send_event(new TextFormattingEvent($post["message"]))->formatted))
+ DIV(["class" => "postMessage"], rawHTML(format_text($post["message"])))
)
),
TR(
@@ -189,7 +189,7 @@ public function display_thread(array $posts, bool $showAdminOptions, string $thr
$this->display_paginator($page, "forum/view/".$threadID, null, $pageNumber, $totalPages);
- $page->set_title(html_escape($threadTitle));
+ $page->set_title($threadTitle);
$page->add_block(new Block($threadTitle, $html, "main", 20));
}
diff --git a/ext/index/theme.php b/ext/index/theme.php
index 05761305b..27f8dc031 100644
--- a/ext/index/theme.php
+++ b/ext/index/theme.php
@@ -124,10 +124,7 @@ protected function display_shortwiki(Page $page): void
$short_wiki_description = '';
if ($wikiPage->id != -1) {
// only show first line of wiki
- $short_wiki_description = explode("\n", $wikiPage->body, 2)[0];
-
- $tfe = send_event(new TextFormattingEvent($short_wiki_description));
- $short_wiki_description = $tfe->formatted;
+ $short_wiki_description = format_text(explode("\n", $wikiPage->body, 2)[0]);
}
$wikiLink = make_link("wiki/$st");
if (Extension::is_enabled(TagCategoriesInfo::KEY)) {
diff --git a/ext/pm/theme.php b/ext/pm/theme.php
index 03525195c..6de27f1e6 100644
--- a/ext/pm/theme.php
+++ b/ext/pm/theme.php
@@ -85,7 +85,7 @@ public function display_composer(Page $page, User $from, User $to, string $subje
public function display_message(Page $page, User $from, User $to, PM $pm): void
{
$page->set_title("Private Message");
- $page->set_heading(html_escape($pm->subject));
+ $page->set_heading($pm->subject);
$page->add_block(new NavBlock());
$page->add_block(new Block("Message from {$from->name}", rawHTML(format_text($pm->message)), "main", 10));
}
diff --git a/ext/pools/theme.php b/ext/pools/theme.php
index 6371bedf0..9d77d7828 100644
--- a/ext/pools/theme.php
+++ b/ext/pools/theme.php
@@ -134,8 +134,7 @@ private function display_top(?Pool $pool, string $heading, bool $check_all = fal
$this->sidebar_options($page, $pool, $check_all);
}
}
- $tfe = send_event(new TextFormattingEvent($pool->description));
- $page->add_block(new Block(html_escape($pool->title), rawHTML($tfe->formatted), "main", 10));
+ $page->add_block(new Block($pool->title, rawHTML(format_text($pool->description)), "main", 10));
}
}
diff --git a/ext/user/theme.php b/ext/user/theme.php
index 1ae1dc8b3..21bc473ab 100644
--- a/ext/user/theme.php
+++ b/ext/user/theme.php
@@ -64,7 +64,7 @@ public function display_signup_page(Page $page): void
$tac = $config->get_string("login_tac", "");
if ($config->get_bool("login_tac_bbcode")) {
- $tac = send_event(new TextFormattingEvent($tac))->formatted;
+ $tac = format_text($tac);
}
$email_required = (
@@ -246,7 +246,7 @@ public function display_user_page(User $duser, array $stats): void
global $page;
$stats[] = 'User ID: '.$duser->id;
- $page->set_title(html_escape($duser->name)."'s Page");
+ $page->set_title("{$duser->name}'s Page");
$page->add_block(new NavBlock());
$page->add_block(new Block("Stats", rawHTML(join("
", $stats)), "main", 10));
}
diff --git a/ext/view/theme.php b/ext/view/theme.php
index 1f8ebd58e..d2c1286c7 100644
--- a/ext/view/theme.php
+++ b/ext/view/theme.php
@@ -36,7 +36,7 @@ public function display_page(Image $image, array $editor_parts): void
{
global $page;
$page->set_title("Post {$image->id}: ".$image->get_tag_list());
- $page->set_heading(html_escape($image->get_tag_list()));
+ $page->set_heading($image->get_tag_list());
$page->add_block(new Block("Post {$image->id}", $this->build_navigation($image), "left", 0, "Navigationleft"));
$page->add_block(new Block(null, $this->build_info($image, $editor_parts), "main", 20, "ImageInfo"));
//$page->add_block(new Block(null, $this->build_pin($image), "main", 11));
diff --git a/ext/wiki/theme.php b/ext/wiki/theme.php
index e0d79d8b5..792a6311b 100644
--- a/ext/wiki/theme.php
+++ b/ext/wiki/theme.php
@@ -25,29 +25,21 @@ public function display_page(Page $page, WikiPage $wiki_page, ?WikiPage $nav_pag
$nav_page->body = "";
}
- $tfe = send_event(new TextFormattingEvent($nav_page->body));
+ $body_html = format_text($nav_page->body);
// only the admin can edit the sidebar
if ($user->can(Permissions::WIKI_ADMIN)) {
- $tfe->formatted .= "
(Edit)"; - } - - // see if title is a category'd tag - $title_html = html_escape($wiki_page->title); - if (Extension::is_enabled(TagCategoriesInfo::KEY)) { - $tagcategories = new TagCategories(); - $tag_category_dict = $tagcategories->getKeyedDict(); - $title_html = $tagcategories->getTagHtml($title_html, $tag_category_dict); + $body_html .= "
(Edit)"; } if (!$wiki_page->exists) { $page->set_code(404); } - $page->set_title(html_escape($wiki_page->title)); + $page->set_title($wiki_page->title); $page->add_block(new NavBlock()); - $page->add_block(new Block("Wiki Index", rawHTML($tfe->formatted), "left", 20)); - $page->add_block(new Block($title_html, $this->create_display_html($wiki_page))); + $page->add_block(new Block("Wiki Index", rawHTML($body_html), "left", 20)); + $page->add_block(new Block($wiki_page->title, $this->create_display_html($wiki_page))); } /** @@ -62,14 +54,14 @@ public function display_page_history(Page $page, string $title, array $history): $html .= "