From cbaa2c1d0ae4d1f0390ca285713fe3c7c6cb820c Mon Sep 17 00:00:00 2001 From: Andrew Patton Date: Thu, 24 Jul 2014 17:22:00 -0400 Subject: [PATCH] Tweak image regexp check to fix #313 Comparing the `.match()` against `false` always returns false, even if `match()` finds nothing and returns `null`. Switched comparison to use `RegExp.test` at the same time for performance (and for simple true or false return type) --- public/js/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/js/app.js b/public/js/app.js index 7ffcbd4a3..fced6d65a 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -536,7 +536,7 @@ function initIssue() { var over = function() { var $this = $(this); - if ($this.text().match(/\.(png|jpg|jpeg|gif)$/i) == false) { + if ((/\.(png|jpg|jpeg|gif)$/i).test($this.text()) === false) { return; }