Opened 12 years ago

Closed 12 years ago

#2206 closed Bug (fixed)

"Call to undefined function" with PHP4

Reported by: Frederico Caldeira Knabben Owned by: Wiktor Walc
Priority: Must have (possibly next milestone) Milestone: FCKeditor 2.6.1
Component: Server : PHP Version: SVN (FCKeditor) - Retired
Keywords: Confirmed Review+ Cc:

Description

The PHP4 integration is not working. It throws the following error:

Fatal error: Call to undefined function FCKeditor_IsCompatibleBrowser() in D:\FCKeditor\SVN\FCKeditor\local\fckeditor_php4.php on line 167

To test it in a PHP5 environment, it is enough to change the include at the top of sample01.php to:

include("../../fckeditor_php4.php") ;

Attachments (1)

2206.2.patch (4.5 KB) - added by Wiktor Walc 12 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 12 years ago by Frederico Caldeira Knabben

This bug has been originally reported at our forums (here).

comment:2 Changed 12 years ago by Wiktor Walc

Documentation states that fckeditor.php should be included: http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/Integration/PHP

Anyway, it may be a good idea to move fckeditor_php4.php and fckeditor_php5.php somewhere deeper into "editor" directory and hide it from other users to avoid such errors.

comment:3 Changed 12 years ago by Alfonso Martínez de Lizarrondo

or maybe rename them fckutils_php4.php and fckutils_php5.php ?
(to avoid having them placed in a different folder that the rest of integration files, and it also express correctly what they are)

comment:4 Changed 12 years ago by Wiktor Walc

Nice idea. Anyway, there is another thing to consider: some people might use include/require calls instead of include_once/require_once. This may ocassionally be causing problems when calling include "fckeditor.php"; twice in the same script. If we move FCKeditor_IsCompatibleBrowser() into fckeditor_php4.php and fckeditor_php5.php, we will get rid of this error and issue described in this ticket as well.

The only disadvantage is that this way we will break DRY rule... but that's not a big deal and we can live with it, at least until V3.

I'm attaching a patch that moves 'FCKeditor_IsCompatibleBrowser() function. It's not an ideal solution, but at least it solves most problems that php beginners may encounter. I believe that it makes no sense to put this into separate file, because we already have plenty of files in the root directory.

Changed 12 years ago by Wiktor Walc

Attachment: 2206.2.patch added

comment:5 Changed 12 years ago by Wiktor Walc

Keywords: Review? added

comment:6 Changed 12 years ago by Frederico Caldeira Knabben

Keywords: Review+ added; Review? removed

It would be a nice idea moving fckeditor_php4.php and fckeditor_php5.php inside the "editor" folder, but it is already too late for that. It may break installations where people is pointing to those files.

So, for now, the proposed patch is ok.

comment:7 Changed 12 years ago by Wiktor Walc

Resolution: fixed
Status: newclosed

Fixed with [2008].

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy