From 50c369833b47f73cd25d496e2ab19d260d88be70 Mon Sep 17 00:00:00 2001 From: Jean-Luc Tibaux Date: Sat, 26 Nov 2022 20:22:01 +0000 Subject: [PATCH] improved imgur regex pattern as requested in #365 --- inc/commons.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/commons.js b/inc/commons.js index 78f449e..6acbab6 100644 --- a/inc/commons.js +++ b/inc/commons.js @@ -200,7 +200,7 @@ module.exports = function(request, fs) { * source: https://github.com/libredirect/libredirect/blob/32c4a0211e3b721d46219c05cba93f1a42cf3773/src/config/config.json#L317 * license: GNU GPL v3 License -> https://github.com/libredirect/libredirect/blob/32c4a0211e3b721d46219c05cba93f1a42cf3773/LICENSE */ - let imgurRegex = /^https?:\/{2}([im]\.)?(stack\.)?imgur\.(com|io)/gm; + let imgurRegex = /(?<=href=")(https?:\/{2})([im]\.)?(stack\.)?imgur\.(com|io)(?=.+")/gm; let protocol = config.https_enabled || config.api_force_https ? 'https://' : 'http://'