|
Michael Blake made changes - 21/Aug/06 03:56 PM
Martin Dougiamas made changes - 23/Aug/06 11:48 PM
Michael Blake made changes - 19/Sep/06 04:08 PM
Assigning to me temporarily because Vy-Shane no longer works for Moodle HQ.
Martin Dougiamas made changes - 21/Feb/07 09:22 AM
We have the same issue with Moodle 1.6.5+ (2006050550) on PHP 5.1.2, Postgresql 8.1.4, and openSUSE 10.1.
"PHP Fatal error: Call to undefined function ctype_space() in .../moodle/lib/searchlib.php on line 296" This function requires the ctype extension for PHP: We have the same issue with Moodle 1.8.2 and 1.8.3 on Mysql 5.0.26 Apache 2.2.0 PHP 5.1.2 Suhosin Patch 0.9.6 and Zend Engine v2.1.0 - SuSE 10.1
Issue closed for SuSE 10.1 / See http://moodle.org/mod/forum/discuss.php?d=80814
As of Moodle 1.8.3, ctype functions are still used in:
course/lib.php The ctype module is optional[1] in PHP, and other distributions (Gentoo for one) optionally include it. Please vote for this issue. [1] http://www.php.net/manual/en/ref.ctype.php#ctype.installation This problem (ctype_space in searchlib) will still exists in Moodle 1.9, and there's another call (ctype_alpha in course/lib.php) that will be a problem for people without ctype.
Possibilities :
Here's a start of a patch.. This needs to be changed depending on whether ctype is required for moodle or not.
Mathieu Petit-Clair made changes - 10/Dec/07 02:54 PM
Chris Bandy made changes - 16/Apr/08 03:19 AM
Hi, just saw this. Two comments:
1) course.lib use looks really trivial, It's being used to check if the fist letter is alpha (and the list of log actions are simple english words). Can be matched with regexp instead. With this... all Moodle 1.9 would be ctype_* free (unless you enable HTMLPurifier or Global search). Perhaps it could be added as OPTIONAL. For 2.0 we must REQUIRE ctype IMO, mainly because HTMLPurifier has high probabilities to become the standard filter and we cannot patch it locally. Ciao
Eloy Lafuente (stronk7) made changes - 16/Apr/08 09:07 AM
Eloy Lafuente (stronk7) made changes - 16/Apr/08 09:09 AM
Raising this to critical. Should be fixed ASAP IMO. Assigning to Mathieu.
Eloy Lafuente (stronk7) made changes - 16/Apr/08 09:11 AM
Adding MartÃn Langhoff to this issue, since he's to author of the code in course/lib.php. MartÃn : is it necessary to use ctype_alpha on line 120? Can $modaction contain non-latin characters?
Mathieu Petit-Clair committed 1 file to 'Moodle CVS' on branch 'MOODLE_19_STABLE' - 16/Apr/08 11:35 AM
Mathieu Petit-Clair committed 1 file to 'Moodle CVS' - 16/Apr/08 11:37 AM
I modified the call in searchlib.php.
Eloy, should I commit the patch (attached to this issue) to 1.9? If we require ctype for 2.0, I will modify the patch for this requirement in head. Hi Mathieu,
I think your patch about doing ctype optional in 1.9 is ok. So +1 for that, with 3 comments: 1) It should be applied from 17_STABLE to HEAD (that way people running older Moodle versions will know about that recommendation, without downloading xml). About your $modaction question for ML... I think I was looking for that when I wrote my previous comment here and I think all I saw were English tokens. So I really think it could be safe to change it. In fact, hehe, exactly in the previous line of the ctype_alpha() call, there is one $firstletter = substr($modaction, 0, 1); and that breaks UTF-8 (non-ascii) strings, so yes, I guess it only can contain english (ascii) letters. Ciao My +1 for optional in 1.9 and required in 2.0.
Ok, as discussed in meeting : ctype recommended until 1.9, required from 2.0. Patches coming in the next few days.
I just had a look on php.net and ctype is enabled by default since php 4.2.0, and builtin since php 4.3.0. Anybody having this problem is on a seriously old host. I'm committing this patch, since I'm done .. but really, this shouldn't be a problem anymore (Moodle won't even run on a php that old!). See (as said above) http://au.php.net/manual/en/ctype.installation.php
Mathieu Petit-Clair committed 5 files to 'Moodle CVS' on branch 'MOODLE_19_STABLE' - 24/Apr/08 11:01 AM
Mathieu Petit-Clair committed 5 files to 'Moodle CVS' - 24/Apr/08 11:07 AM
Mathieu Petit-Clair committed 1 file to 'Moodle CVS' - 24/Apr/08 11:24 AM
Fixed in MOODLE_19_STABLE, merged in HEAD. Should the ctype_* removals be backported?
Mathieu Petit-Clair made changes - 24/Apr/08 11:25 AM
Mathieu Petit-Clair committed 1 file to 'Moodle CVS' - 24/Apr/08 02:40 PM
Mitsuhiro Yoshida committed 1 file to 'Lang CVS' - 25/Apr/08 02:02 AM
martignoni committed 1 file to 'Lang CVS' - 28/Apr/08 02:52 PM
Hi Mathieu,
I really think patches are ok. Anyway, I'd backport them to 1.8 as they are trivial and can make life better for some sites. FYC... with MD. feel free to close this definitively once backported (or not backported). Only one small comment... install/lang/xxx file must not be edited by us at all. All we need to do it to add them to the install/stringnames.txt file and then one nightly process will build automatically the install/lang/xxx files. Ciao
Eloy Lafuente (stronk7) made changes - 29/Apr/08 08:31 AM
Mathieu Petit-Clair committed 4 files to 'Moodle CVS' on branch 'MOODLE_18_STABLE' - 01/May/08 04:07 PM
Mathieu Petit-Clair committed 1 file to 'Moodle CVS' on branch 'MOODLE_19_STABLE' - 01/May/08 04:10 PM
Mathieu Petit-Clair committed 1 file to 'Moodle CVS' - 01/May/08 04:10 PM
Backported to 1.8. Eloy: it's not clear to me if /admin/environment.xml must be the same over all versions, but I did make the same changes in 1.8, 1.9 and head. Should this file be the same in 16 and 1.7?
Mathieu Petit-Clair made changes - 01/May/08 04:12 PM
Well, really it shouldn't be necessary as long as the xml file can be updated online from download.moodle.org.
I really think in this case it's enough to backport up to 1.8, because when the ctype is going to be a requirement is 2.0, and 2.0 requires 1.9 to be installed so everybody will have that info. So, I think this is ok as is now. Thanks! |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Forgot to mention php version 4.1.2
From Herbert Keijers (herbert.keijers at vanhorne.nl) Sunday, 5 June 2005, 05:20 PM:
Some (elder) php4 versions do not support the ctype functions.
So it is not a bug.
See my postings in : http://moodle.org/mod/forum/discuss.php?d=24762