FCK Editor not working

14.2k views Asked by At

FCK Editor is not loading for IE11. This is due to the new user agent for IE11.

Similar problem came with IE10 which had the following fix-

var sBrowserVersion = navigator.appVersion.match(/MSIE ([\d.]+)/)[1] ; (refer-FCKEditor doesn't work in IE10)

Is there a similar kind of fix for IE11 also ?

Please Help.

6

There are 6 answers

0
Tzah Gilboa On

Same problem for me, currently i fixed it with compatibility view settings

0
LiquidFlux On

We resorted to emulating IE10 for the sake of FCKEditor with a META tag.

<meta http-equiv="x-ua-compatible" content="IE=10">

Apparently this needs to be before all other META tags.

0
Ayush Kumar On

Try this:

navigator.appVersion.match(/rv:([\d.]+)/)[1]

Since IE11 user Agent String doesn't have MSIE key, therefore the exact version is given by rv: key.

0
stu On

I added the following to the bottom of the fckeditor.js file underneath the safari check

// Safari 3+
if ( sAgent.indexOf( ' applewebkit/' ) != -1 )
    return (sAgent.match(/ applewebkit\/(\d+)/)[1] >= 522); // Build must be at least 522 (v3)

// Internet Explorer 11
    var sBrowserVersion = navigator.appVersion.match(/Trident\/.+; rv:(\d+)/)[1]
if (sBrowserVersion) {
    return (sBrowserVersion >= 10);
}
0
elDoctorWho On

In order to fix this issue (FCKEditor compatibility with IE11), you have to add the IE 11 check to FCKEditor within the appropriate file that generates the editor instance. In our case this is fckeditor_php5.php:

else if ( strpos($sAgent, 'Gecko') !== false )
{
    // Internet Explorer 11
    $iVersion = (int)substr($sAgent, strpos($sAgent, 'rv:') + 3, 2) ;
    return ($iVersion >= 11) ;
}

Note: the above was added to function FCKeditor_IsCompatibleBrowser().

Then you have to add emulation for IE 9 or IE 8 to the page (IE 10 did not work for us):

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9" />

Note: the above has to be added within the head tag

0
ywarnier On

The answer from H Solano is great, however there is apparently a case where Chrome 34 under Ubuntu gets the FCK Editor validation wrong. So I added a small condition:

else if ( strpos($sAgent, 'Gecko') !== false ) {
  if (strpos($sAgent, 'Chrome') !== false) {
    // Just for Chrome 34 under Ubuntu with a rv: <11
    return true;
  }
  // Internet Explorer 11
  $iVersion = (int)substr($sAgent, strpos($sAgent, 'rv:') + 3, 2) ;
  return ($iVersion >= 11) ;
}