summaryrefslogtreecommitdiff
path: root/lib/frontend.php
diff options
context:
space:
mode:
authorlolcat <will@lolcat.ca>2023-07-26 19:03:06 -0400
committerlolcat <will@lolcat.ca>2023-07-26 19:03:06 -0400
commit16ee0b368fcf24b48574172726e32a19c275d691 (patch)
tree563a53aa23bda137c3651d782990fd2e8fb39c13 /lib/frontend.php
parentbca265aea67ec62499aaa113a6490ce9ec7fe730 (diff)
felt quirky, might commit later
Diffstat (limited to 'lib/frontend.php')
-rw-r--r--lib/frontend.php17
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/frontend.php b/lib/frontend.php
index 3be912b..e03eb1d 100644
--- a/lib/frontend.php
+++ b/lib/frontend.php
@@ -143,7 +143,7 @@ class frontend{
$payload .=
'">' .
- '<img class="thumb" src="/proxy?i=' . urlencode($site["thumb"]["url"]) . '&s=' . $size . '" alt="thumb">';
+ '<img class="thumb" src="' . $this->htmlimage($site["thumb"]["url"], $size) . '" alt="thumb">';
if($duration !== null){
@@ -1273,6 +1273,21 @@ class frontend{
return http_build_query($out);
}
+ public function htmlimage($image, $format){
+
+ if(
+ preg_match(
+ '/^data:/',
+ $image
+ )
+ ){
+
+ return htmlspecialchars($image);
+ }
+
+ return "/proxy.php?i=" . urlencode($image) . "&s=" . $format;
+ }
+
public function htmlnextpage($gets, $npt, $page){
$query = $this->buildquery($gets);