FCKEditor Year 2010 Bug for Firefox 3.6 with ColdFusion

January 21, 2010
web

If you are having problems using FCKeditor on Firefox 3.6, it's due to a, lets call it a Year 2010 bug. You will see a textarea instead of the editor. This probably only exists in the ColdFusion version, I haven't checked the other versions...

The useragent for Firefox 3.6 might look like this:

Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6

The problem is on line 47 of fckutils.cfm located in the root of the fckeditor install:

stResult = reFind( "gecko/(200[3-9][0-1][0-9][0-3][0-9])", sAgent, 1, true );

Yes that right any gecko browser made after Jan 1, 2010 will fail to match their test.

You can change it to something like this:

stResult = reFind( "gecko/(20[0-9][0-9][0-1][0-9][0-3][0-9])", sAgent, 1, true );

That will give you another 90 years of FCKeditor use on Firefox.

Note this problem will not exist on all versions of FCKeditor, you can also pass checkBrowser=false to the FCKeditor component and it will disable this check. I tried cftextarea on CF9 and it appears to work without modification.

Note: If you don't have a fckutils.cfm file look for a similar line in fckeditor.cfc. Also in some versions of FCKeditor you might get an error stating that the variable width is not defined (due to a bug in showing the textarea).

PS: If you need a ColdFusion Spell Checker for FCKeditor or cftextarea check out Foundeo's Spell Checker Product.


Like this? Follow me ↯


15 people found this page useful, what do you think?

Comments

Switch to CKEditor instead. It's a Javascript only add-on. No ColdFusion version.
@Brian - Yes that is probably the best course of action. Have you found the migration to be simple?

@Francis - You're Welcome!

@Sebastiaan - I've changed the rule to allow hotmail addresses again, I was getting a ton of spam at one point from hotmail addresses, we'll see how it goes. You need to do more than just change the [3-9] to [0-9], you also need to the change the 0 before it.
We indeed changed this in our fckutils.cfm: stResult = reFind( "gecko/(20[0-9][0-9][0-1][0-9][0-3][0-9])", sAgent, 1, true );
Many thanks, Pete - very useful info!
Thanks Pete!
I'm having issues with cffinder since upgrading to firefox 3.6. it does not show image names or the upload button.

any thoughts.
Hey Pete...

Running CF8 locally and I changed that line in both of my instances, and restarted ColdFusion and I'm still getting the plain textarea within FF3.6.

Any ideas?
@Andy - Hmm, not sure double check that you changed the regex properly. Are you using cftextarea to invoke FCKeditor, or are you invoking it directly?
Pete...

Turns out I was editing the FCK instance within my JRun folders when I should have been editing a stand alone instance we manually installed. Got it working now.
rock on!!!
Pete,

Thanks for the start! I changed mine to use a regular expression of gecko/(20(0[3-9]|[1-9][0-9])[0-1][0-9][0-3][0-9]) .... because the comment above the regular expression in fckeditor.cfc says to check for Gecko ( >= 20030210+ ).

Yours will pass if the Gecko version date is 20010210 - this one won't

-Bridget
Also, note I had to change:
if( arrayLen( stResult.pos ) eq 2 )

to

if( arrayLen( stResult.pos ) gt 2 )
Awesome, you just saved us a lot of grief.

If anyone's using an older version of FckEditor (e.g. 2.4.3), apply Pete's fix to fckeditor.cfm and fckeditor.cfc.
Mansi...

I had a similar problem. It turned out that I was editing the right file, but in the wrong location. My system had two instances of FCKEditor and I was editing the one that was NOT being used. Perhaps you're having a similar problem?
@Gordon
We have a custom install of FCK Editor, rather than the one which comes with ColdFusion 8. I was working on the native version.
Doesn't work. I am using Drupal 5.x. and phplist. Both of them is not working on Firefox which I have upgraded to Namoroka . Not sure which version of Firefox it is. About said Firefox 3.6.6pre...
I was about to tell the client something along the lines of... "well don't use Firefox then..." Thanks a lot for the solution.


Foundeo Inc.