summaryrefslogtreecommitdiff
path: root/images.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 /images.php
parentbca265aea67ec62499aaa113a6490ce9ec7fe730 (diff)
felt quirky, might commit later
Diffstat (limited to 'images.php')
-rw-r--r--images.php21
1 files changed, 2 insertions, 19 deletions
diff --git a/images.php b/images.php
index 67a50e8..2c0799e 100644
--- a/images.php
+++ b/images.php
@@ -58,32 +58,15 @@ if(count($results["image"]) === 0){
foreach($results["image"] as $image){
- $domain = htmlspecialchars(parse_url($image["url"], PHP_URL_HOST));
-
- $c = count($image["source"]) - 1;
-
- if(
- preg_match(
- '/^data:/',
- $image["source"][$c]["url"]
- )
- ){
-
- $src = htmlspecialchars($image["source"][$c]["url"]);
- }else{
-
- $src = "/proxy?i=" . urlencode($image["source"][$c]["url"]) . "&s=thumb";
- }
-
$payload["images"] .=
'<div class="image-wrapper" title="' . htmlspecialchars($image["title"]) .'" data-json="' . htmlspecialchars(json_encode($image["source"])) . '">' .
'<div class="image">' .
'<a href="' . htmlspecialchars($image["source"][0]["url"]) . '" rel="noreferrer nofollow" class="thumb">' .
- '<img src="' . $src . '" alt="thumbnail">' .
+ '<img src="' . $frontend->htmlimage($image["source"][count($image["source"]) - 1]["url"], "thumb") . '" alt="thumbnail">' .
'<div class="duration">' . $image["source"][0]["width"] . 'x' . $image["source"][0]["height"] . '</div>' .
'</a>' .
'<a href="' . htmlspecialchars($image["url"]) . '" rel="noreferrer nofollow">' .
- '<div class="title">' . htmlspecialchars($domain) . '</div>' .
+ '<div class="title">' . htmlspecialchars(parse_url($image["url"], PHP_URL_HOST)) . '</div>' .
'<div class="description">' . $frontend->highlighttext($get["s"], $image["title"]) . '</div>' .
'</a>' .
'</div>' .