From 2e9c51889d8855cf56cb3f21a9c4926bd94ef21f Mon Sep 17 00:00:00 2001
From: Andreas Gohr <andi@splitbrain.org>
Date: Sun, 27 Nov 2011 16:52:41 +0100
Subject: [PATCH] IE8: fix namespace selection in link wizard FS#2391

IE8 can't substr() with negative offsets.
---
 lib/scripts/linkwiz.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/scripts/linkwiz.js b/lib/scripts/linkwiz.js
index cc4c19e0d..ce072d4b2 100644
--- a/lib/scripts/linkwiz.js
+++ b/lib/scripts/linkwiz.js
@@ -186,7 +186,7 @@ var dw_linkwiz = {
      */
     resultClick: function(a){
         dw_linkwiz.$entry.val(a.title);
-        if(a.title == '' || a.title.substr(-1) == ':'){
+        if(a.title == '' || a.title.substr(a.title.length-1) == ':'){
             dw_linkwiz.autocomplete_exec();
         }else{
             if (jQuery(a.nextSibling).is('span')) {
-- 
GitLab