From a78925d2856cfc03314bcf23d9f7c3a102314980 Mon Sep 17 00:00:00 2001 From: Jonah Lawrence Date: Tue, 18 Jan 2022 17:58:34 -0700 Subject: [PATCH] fix(site): image load error handler --- index.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index a012e6a..d99c418 100644 --- a/index.php +++ b/index.php @@ -215,7 +215,9 @@ if (isset($_GET['random'])) { // if imgproxy version fails to load, fallback to full-size image document.querySelectorAll(".gallery img").forEach(function(img) { - this.src = this.parentElement.href; + img.addEventListener("error", function() { + this.src = this.parentElement.href; + }); });