summaryrefslogtreecommitdiff
path: root/lib/frontend.php
diff options
context:
space:
mode:
authorlolcat <will@lolcat.ca>2024-02-17 23:22:19 -0500
committerlolcat <will@lolcat.ca>2024-02-17 23:22:19 -0500
commitaddc5a14a93547f630f23e5b6a79cffa2e37d71a (patch)
treea9163ba3a2e24c3c493cdde95e506c0e7e8a772d /lib/frontend.php
parentedc917f5ee984160a0eef436dabd51696d675964 (diff)
boobs
Diffstat (limited to 'lib/frontend.php')
-rw-r--r--lib/frontend.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/frontend.php b/lib/frontend.php
index b002ee9..738ad83 100644
--- a/lib/frontend.php
+++ b/lib/frontend.php
@@ -39,6 +39,14 @@ class frontend{
$replacements["ac"] = '';
}
+ if(
+ isset($replacements["timetaken"]) &&
+ $replacements["timetaken"] !== null
+ ){
+
+ $replacements["timetaken"] = '<div class="timetaken">Took ' . substr(microtime(true) - $replacements["timetaken"], 0, 4) . 's</div>';
+ }
+
$handle = fopen("template/{$template}", "r");
$data = fread($handle, filesize("template/{$template}"));
fclose($handle);
@@ -68,7 +76,7 @@ class frontend{
echo
$this->load("header.html", [
- "title" => trim($get["s"] . " ({$page})"),
+ "title" => trim(htmlspecialchars($get["s"]) . " ({$page})"),
"description" => ucfirst($page) . ' search results for &quot;' . htmlspecialchars($get["s"]) . '&quot;',
"index" => "no",
"search" => htmlspecialchars($get["s"]),
@@ -88,7 +96,7 @@ class frontend{
$this->drawerror(
"Tshh, blocked!",
- 'You were blocked from viewing this page. If you wish to scrape data from 4get, please consider running <a href="https://git.lolcat.ca/lolcat/4get" rel="noreferrer nofollow">your own 4get instance</a> or using <a href="/api.txt">the API</a>.',
+ 'You were blocked from viewing this page. If you wish to scrape data from 4get, please consider running <a href="https://git.lolcat.ca/lolcat/4get" rel="noreferrer nofollow">your own 4get instance</a>.',
);
die();
}
@@ -98,6 +106,7 @@ class frontend{
echo
$this->load("search.html", [
+ "timetaken" => null,
"class" => "",
"right-left" => "",
"right-right" => "",