Skip to content

Commit

Permalink
Revert "Check GET parameters in image embedding"
Browse files Browse the repository at this point in the history
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 b939bc7.
  • Loading branch information
vivien committed Feb 8, 2015
1 parent c57911d commit 06e3a85
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions js/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -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/");
Expand Down

0 comments on commit 06e3a85

Please sign in to comment.