Project

General

Profile

Bug #5752

Firefox 17 update breaks FCKeditor online WYSIWYG editor

Added by Yannick Warnier over 9 years ago. Updated over 9 years ago.

Status:
Bug resolved
Priority:
Urgent
Category:
Plugins
Target version:
Start date:
22/11/2012
Due date:
% Done:

100%

Estimated time:
Complexity:
Normal
SCRUM pts - complexity:
?

Description

Upgrading Firefox to v17 has generated a change in the User-Agent string, which is used by several JavaScript applications to try and locate browsers capabilities.

This change, from something like this:
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20100101 Firefox/17.0

...to something like this:
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Firefox/17.0
(as reported here: https://groups.google.com/forum/?fromgroups=#!topic/mozilla.engagement.developers/jzdH7q4JhoM)

breaks this detection by FCKEditor. As such, it will stop working when you use it with Firefox 17 (as reported here: https://support.mozilla.org/es/questions/942438 )

To fix this, the code of FCKeditor should be updated to suit the change. Locate the main/inc/lib/fckeditor/fckeditor.php file and go to line 61. Change this code:

    else if ( strpos($sAgent, 'Gecko/') !== false )
    {
        $iVersion = (int)substr($sAgent, strpos($sAgent, 'Gecko/') + 6, 8) ;
        return ($iVersion >= 20030210) ;
    }

to this code:

    else if ( strpos($sAgent, 'Gecko/') !== false )
    {
        $iVersion = substr($sAgent, strpos($sAgent, 'Gecko/') + 6, 8) ;
        if ( preg_match('/^\d{2,3}\.\d{1,4}\s/', $iVersion) ) {
          return true;
        }
        $iVersion = (int)$iVersion;
        return ($iVersion >= 20030210) ;
    }

This hasn't been tester in production yet (couldn't find a FF17 around), so please report if it works for you.


Files

despues-F17.png (64.9 KB) despues-F17.png Michela Mosquera, 22/11/2012 21:19
error-fie10.png (46.9 KB) error-fie10.png Michela Mosquera, 22/11/2012 21:20

Associated revisions

Revision 58699ec3 (diff)
Added by Yannick Warnier over 9 years ago

Tentative fix for the FCKeditor detection flaw for Firefox 17 - refs #5752

Revision 5d6816fd (diff)
Added by Yannick Warnier over 9 years ago

Tentative fix for the FCKeditor detection flaw for Firefox 17 - added comment - refs #5752

History

#1

Updated by Michela Mosquera over 9 years ago

Prueba de Mozilla 17: FUNCIONA!

#2

Updated by Michela Mosquera over 9 years ago

Adjunto pantalla como estaba antes del arreglo:

#3

Updated by Julio Montoya over 9 years ago

Works for me FF17 in Ubuntu

#4

Updated by Jan Derriks over 9 years ago

Isn't it great that when a highly respected teacher emails me a problem with announcements, the answer is posted here 16 hours earlier?
Thanks Yannick, works fine with FF17 on windows[7-8].

#5

Updated by Juan Carlos Raña Trabado over 9 years ago

#6

Updated by Alain Deschênes over 9 years ago

Version chamilo-1.9.4-nightly-2012-11-23 testé sur mon serveur avec Firefox 17.0 et tout fonctionne normalement.

#7

Updated by Alain Deschênes over 9 years ago

J'ai trouvé un peu plus simple:

../main/inc/lib/fckeditor/fckeditor.php

Remplacer à la ligne 62

return ($iVersion >= 20030210) ;

par

return ($iVersion >= 13) ;

Et le tour est joué,

Alain

#8

Updated by Marc De Caluwé over 9 years ago

Solution works perfect in Firefox 17 on Ubuntu. Thanks a lot!

#9

Updated by Hubert Borderiou over 9 years ago

That's just great. Thanks.

#10

Updated by Yannick Warnier over 9 years ago

  • Status changed from Assigned to Bug resolved
  • % Done changed from 0 to 100

Firefox 17.0.1 has fixed the problem anyway, by returning to the previous user agent style.

Also available in: Atom PDF