From c4bddc993d5a598a52dc693502bc03a709cf4285 Mon Sep 17 00:00:00 2001 From: Vivien Didelot Date: Sun, 8 Feb 2015 16:09:01 -0500 Subject: [PATCH] Revert "Check GET parameters in image embedding" There's no need to check for every GET parameters (using the line ending '$' character), we can just add a word boundary (the '\b' character) instead. Thus, revert commit b939bc7ca8d189af19efad90d38ff49479964ab9. --- js/plugins.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/js/plugins.js b/js/plugins.js index 296fa0e..b282d13 100644 --- a/js/plugins.js +++ b/js/plugins.js @@ -250,14 +250,7 @@ plugins.factory('userPlugins', function() { * Image Preview */ var imagePlugin = new UrlPlugin('image', function(url) { - var embed = false; - // Check the get parameters as well, they might contain an image to load - var segments = url.split(/[?&]/).forEach(function(param) { - if (param.match(/\.(png|gif|jpg|jpeg)(:(small|medium|large))?$/i)) { - embed = true; - } - }); - if (embed) { + if (url.match(/\.(png|gif|jpg|jpeg)(:(small|medium|large))?\b/i)) { /* A fukung.net URL may end by an image extension but is not a direct link. */ if (url.indexOf("^https?://fukung.net/v/") != -1) { url = url.replace(/.*\//, "http://media.fukung.net/imgs/");