More problems with truncated text

More problems with truncated text

by Steve Garcia -
Number of replies: 4
I just upgraded to Moodle 1.8.1 and am having some serious problems with truncated text in the assignment module. An earlier report of truncated text in 1.7.1 was associated with apostrophes in the text, but that doesn't seem to be an issue here.

I have 60 students working on their first homework -- so far 6 have started submitting answers, and of those, two are unable to get all their answers accepted. If they type additional material into the answer box, after a save, all the new text is gone.

I have logged in to their accounts and tried it myself. Exactly the same thing happens. In some cases, using the HTML editor to change font formatting (bold, etc.) will cause the modified text and all subsequent text to disappear.

This is not a visual effect -- that text is gone.

I can't blame the HTML editor, because the problem persists using plain web forms.

Debian Etch AMD64, PHP 5.2.0-8+etch4, MySQL 5.0.32-Debian_7etch1

There appears to be a newer version of PHP for etch i386, but not for AMD64.
If anyone knows of an entry for the sources file for a newer version for Debian Etch AMD64, please let me know. I know the problem cited for the apostrophes was PHP related, I don't know if this is the same problem or not.

I might have to build from scratch, but that's pretty risky with an existing installation and a pain going forward...

Average of ratings: -
In reply to Steve Garcia

Re: More problems with truncated text

by Steve Garcia -
Hmmm. Some additional testing -- It appears to be a problem after editing a page. I have been able to submit a fairly large page and it is all accepted. If I then try to edit that page, any new additions are ignored, and in some cases internal edits trigger truncation.

However, if I wipe the page, save it empty, and then cut and paste it as one piece, with changes, it saves it successfully.

If I try to edit an existing page, for the most part, I cannot add anything to the end. It just gets dropped. Adding stuff in the middle seems to work OK.
In reply to Steve Garcia

Re: More problems with truncated text

by Steve Garcia -
OK, it still seems to be a PHP issue. I shut down the site, uninstalled PHP5 and installed PHP4, and all is behaving. <sigh>
In reply to Steve Garcia

Re: More problems with truncated text

by chris dennison -
Hi, I've had problems with truncated wiki pages when I upgraded to 1.8.

My problems went away if I commented out line lib/weblib.php line 1680 which was:

$text = strip_tags($text, $ALLOWED_TAGS);

See if that fixes the problem - then if it does someone brighter than me can figure out why smile
In reply to chris dennison

Re: More problems with truncated text

by Mauno Korpelainen -

Be careful, Chris!

There are two similar lines in weblib.php:

            /// Remove tags that are not allowed
                $text = strip_tags($text, $ALLOWED_TAGS);

            /// Clean up embedded scripts and , using kses
                $text = cleanAttributes($text);

            /// Again remove tags that are not allowed
                $text = strip_tags($text, $ALLOWED_TAGS);

and if you start commenting these there is a risk that soon ANY tags are allowed...