From e7e05d8e8c2a668c24dea67c5979f9750b38cfc4 Mon Sep 17 00:00:00 2001 From: Frans de Jonge Date: Thu, 7 Apr 2016 11:38:25 +0200 Subject: [PATCH] Fix up getSmileyCode() --- quickQuote.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/quickQuote.js b/quickQuote.js index 341c0c9..8bb5092 100644 --- a/quickQuote.js +++ b/quickQuote.js @@ -225,8 +225,11 @@ function initializeQuickQuote() { /* * getSmileyCode() - returns smiley code */ - function getSmileyCode(img){ - if (!img.src.match(/^http:\/\/thedndsanctuary\.eu\/Smileys\/(default|myopera)\/(\w+)\.gif$/)) + function getSmileyCode(img) { + var re = '^' + location.protocol + '\/\/' + location.hostname + '.+' + '\/smileys\/\\w+\/(\\w+)\\.gif$'; + re = re.replace(/\//g, '\\/') + re = new RegExp(re); + if (!img.src.match(re)) return ''; // Event not spawned by a forum smiley (else match smiley name below) else {