From 3ac95d5a673db544d7ceeaa9e5fca766cb738120 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Mon, 28 Jul 2008 02:43:02 -0400
Subject: [PATCH] #1485230: allow only images (by filename extension) in tinyMCE's images selector

---
 program/js/editor_images.js |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/program/js/editor_images.js b/program/js/editor_images.js
index 373b44e..36fc1ab 100644
--- a/program/js/editor_images.js
+++ b/program/js/editor_images.js
@@ -15,6 +15,8 @@
             fname = liElem.childNodes[j].nodeValue;
          }
       }
-      tinyMCEImageList.push([fname, rc_client.env.comm_path+'&_action=display-attachment&_file='+attachElems[i].id]);
+      
+      if (fname.match(/\.(bmp|gif|png|jpg|jpeg)$/))
+        tinyMCEImageList.push([fname, rc_client.env.comm_path+'&_action=display-attachment&_file='+attachElems[i].id]);
    }
 };

--
Gitblit v1.9.1