Forum posts add unwanted characters and won't apply the HTML

Forum posts add unwanted characters and won't apply the HTML

by Milli Thornton -
Number of replies: 40

I'm using Moodle 1.9.5+ (Build: 20090715)

My problem started this morning, April 27. By looking at forum posts made this morning, I can tell the glitch started some time after 9 a.m. and before 10:33 a.m.

Forum posts prepared in the WYSIWYG now contain a backslash wherever apostrophes or quote marks are part of the text. Simple formatting, such as italics, does not "take." Neither do URLs applied in the usual manner, using the chain link icon.

I tried disabling WYSIWYG but that didn't make much difference. Backslashes still appear in the text for apostrophes or quote marks. Italics do work now (using HTML code) but the code for adding a link doesn't appear at all, not even as visible code in the text of the forum post.

I have not changed any settings in Moodle in recent memory, except for one. Yesterday I gave one of my students Teacher capabilities. I took her off the Teacher list just now, just in case something was screwing up with that, but it didn't help.

Thank you for any light you can shed on this.

Average of ratings: -
In reply to Milli Thornton

Re: Forum posts add unwanted characters and won't apply the HTML

by Rebecca Ruhlen -

We are having the exact same problem; it also started sometime on 4/27.  I haven't changed any settings that I'm aware of.  Will watch this thread closely in hopes of getting help soon! Thanks. 

In reply to Rebecca Ruhlen

Re: Forum posts add unwanted characters and won't apply the HTML

by Robert Felix -

Rebecca, would you happen to be using Hostmonster for your hosting service?

In reply to Milli Thornton

Re: Forum posts add unwanted characters and won't apply the HTML

by Robert Felix -

Having the same problem. Started today.  No changes made on our end. I thought it might have something to do with upgrading Firefox to version 12, but the problem is the same with other browsers.

Grateful for any suggestions.

In reply to Robert Felix

Re: Forum posts add unwanted characters and won't apply the HTML

by Milli Thornton -

Bob - Before I posted here I tried it out on different browsers, and even on a different computer. I tried to eliminate everything I could before posting my problem. Relieved to hear you had the same results.

Rebecca - Grateful for your post. I'm now convinced this is some Moodle update and all we can do is wait for them to fix it. I hope someone comes soon. This gives a messy appearance to posts made for (and by) paying students. Plus some of the basic functions of WYSIWYG are no longer usable. (I haven't checked on everything - but I know emoticons no longer work either.)

In reply to Milli Thornton

Re: Forum posts add unwanted characters and won't apply the HTML

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

Bob and Rebecca - could you say which version your Moodles are please? Milli - you say yours is 1.9.5 from 2009 - do you know if your admin has done an  update or added a patch in the last couple of days? Because if your Moodle hasn't  been changed or updated at all then we need to look at other differences - like browsers  and computers, which you sensibly already tried. I don't have a 1.9.5 to try but I do have a 1.9.8 with no alterations and that seems ok with the forum posts, so looking for clues

In reply to Mary Cooch

Re: Forum posts add unwanted characters and won't apply the HTML

by Milli Thornton -

Thanks, Mary. Glad you're here.

When you say "my admin" do you mean my host service? Hostmonster? Want to be able to answer your question properly and help provide clues.

I know my husband (IT guy) has already looked at my Moodle files and nothing has changed there recently.

P.S. I'm the only one who makes admin changes inside of Moodle, and I haven't done anything significant. My husband makes the significant changes but he hasn't touched it lately.

In reply to Milli Thornton

Re: Forum posts add unwanted characters and won't apply the HTML

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

Hi Milli. Well if you have admin access and you know you haven't altered anything then, yes we'd have to look at your host service. I wonder what the other 2 have in common with you - and I wonder who their hosts are? I am starting to think it is not a Moodle issue but something that's changed outside of Moodle.

In reply to Mary Cooch

Re: Forum posts add unwanted characters and won't apply the HTML

by Milli Thornton -

Thank you, Mary. I will ask my husband to check on Hostmonster to see if they did any updates on the 27th.

Hopefully Bob and Rebecca will see these messages and come back to mention who they host with. And, as you requested, which version of Moodle they use.

In reply to Milli Thornton

Re: Forum posts add unwanted characters and won't apply the HTML

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

Just a final thought - to rule it out - do you have email-based self registration? There is no chance you might have been hacked is there? Have you checked the logs to see if people have been trying to log in as admin? (not that they would need to, to hack you, but just worth making sure. I wouldn't imagine it is, as three people have reported the same issue in the last 24 hours, but always worth checking.)

In reply to Mary Cooch

Re: Forum posts add unwanted characters and won't apply the HTML

by Milli Thornton -

Good thoughts. Well worth checking.

No, I don't use email-based self registration. I haven't checked my logs but my students are all very loyal. I know exactly who all my students are and they love me too much to try to hack me. smile  Even accidental seems unlikely. They're mostly not tech-savvy enough to try to login any other way than what they're used to.

But I'll go check my logs, in case a professional hacker tried. Thanks.

In reply to Milli Thornton

Re: Forum posts add unwanted characters and won't apply the HTML

by Milli Thornton -

Mary, I checked my logs for April 27, looking specifically at that time between 9 a.m. (when a student posted an assignment that had no backslashes in it) and 10:33 when I posted something that showed up with backslashes, no italics and not showing the URL I'd added. I was the only one who logged in during that time, and I recognize and remember all of my recorded actions as legit. (I checked the IP address and it was consistent throughout - only my IP address is showing for those times.)

In reply to Milli Thornton

Re: Forum posts add unwanted characters and won't apply the HTML

by Milli Thornton -

Re: Hostmonster updates

The only one we've been notified of was from April 13:

We're pleased to inform you that the server hosting your XXXXXX website will be undergoing a major software upgrade, from CentOS 5 to CentOS 6, within the next 48 hours.

This upgrade includes newer software packages (including Python, Perl and gcc), as well as all the security and performance benefits that come along with CentOS 6. In addition to this, the server will be redeployed with a different file system type simultaneously, further increasing performance.

In reply to Milli Thornton

Re: Forum posts add unwanted characters and won't apply the HTML

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

Hmm.. I don't understand much of the server side but it will be interesting to see what the other two say about their webhost and any changes. I also hope that as this has become a popular thread, others might be prompted to post their experiences too.

EDIT - Bob - I just saw your post and you also are hosted by Hostmonster - so....thoughtful

In reply to Mary Cooch

Re: Forum posts add unwanted characters and won't apply the HTML

by Robert Felix -

Interesting - I'll check with them again about this.  I'll also check the editor settings and files.

In reply to Milli Thornton

Re: Forum posts add unwanted characters and won't apply the HTML

by Robert Felix -

Milli, I recall that update being completed (confirmed by contacting Hostmonster), and there weren't any problems after that, until now.

In reply to Mary Cooch

Re: Forum posts add unwanted characters and won't apply the HTML

by Robert Felix -

Thought about that possibility (script injection or something), and will check the logs...

In reply to Mary Cooch

Re: Forum posts add unwanted characters and won't apply the HTML

by Robert Felix -

I don't use email-based self registration either.  And haven't received any notifications of failed login attempts.

In reply to Mary Cooch

Re: Forum posts add unwanted characters and won't apply the HTML

by Robert Felix -

Hi Mary,

I have two installations, both version 1.9.10

Both have been working fine until today.  I have not installed any updates or patches to these installations and it doesn't look like anything else has changed besides this strange editor behaviour.

I also checked with my hosting service (Hostmonster), who said there hadn't been any updates to my server.

Glad that I'm not alone in this. Strange situation though.
Thanks!

In reply to Robert Felix

Re: Forum posts add unwanted characters and won't apply the HTML

by Milli Thornton -

My husband logged into Hostmonster and there were recommended updates for users to apply . . . but those were all for WordPress.

That notification was at the top when he logged into Hostmonster. If there's anywhere else we should be looking for a Hostmonster issue that's transferring to Moodle, he says he's not sure where he should be looking.

In reply to Milli Thornton

Re: Forum posts add unwanted characters and won't apply the HTML

by Itamar Tzadok -

Just a shot in the 1.9 dark. It may be worthwhile to look into disabling the HTML tidy filter if enabled (at least until more information becomes available). I don't have 1.9 environment to investigate myself, but some other problems with the editor's html formatting have been recently resolved by disabling this filter. smile

In reply to Itamar Tzadok

Re: Forum posts add unwanted characters and won't apply the HTML

by Robert Felix -

Thanks Itamar, do you know offhand where this is set?

I did check the files in the \lib\editor folders, and nothing has been changed there - at least all the file dates are the same as they were when I originally installed Moodle.

I do see that there is a folder for TinyMCE. Perhaps there is a way to switch to that instead of htmlarea? I'm looking into this next.

In reply to Robert Felix

Re: Forum posts add unwanted characters and won't apply the HTML

by Itamar Tzadok -

The filter does not change files, it just filters text before output and it depends on the php filter which may have been upgraded by your host. It should be managable (enabled/disabled) from site administration (I don't remember how it is organized in 1.9 so I can't say where exactly). smile

In reply to Itamar Tzadok

Re: Forum posts add unwanted characters and won't apply the HTML

by Milli Thornton -

Thanks Itamar.

I found the HTML tidy filter under Site Admin > Modules > Filters.

Mine has the shut-eye symbol next to it and nowhere to change the settings, so it looks like mine has never been enabled.

In reply to Milli Thornton

Re: Forum posts add unwanted characters and won't apply the HTML

by Itamar Tzadok -

Too bad. I found some other possible leads but they lead to the server. The php setting magic_quotes_gpc should be off (in php.ini). If the php version provided by your host is 5.3 and above, the setting is deprecated and so probably not the problem. But wouldn't hurt to check with the host. Some other system settings that are mentioned in a reference to a similar problem and should be off are "standard_conforming_strings" and "escape_string_warning" in the PostgreSQL database configuration. So if that's the database provided by your host, it may be worthwhile to look into that. smile

Average of ratings: Useful (1)
In reply to Itamar Tzadok

Re: Forum posts add unwanted characters and won't apply the HTML

by Milli Thornton -

Thank you, Itamar. This sounds more complex than I can handle so I'll get my IT husband to look at what you wrote and check with our host. Will report back when I know something.

In reply to Itamar Tzadok

Re: Forum posts add unwanted characters and won't apply the HTML

by Robert Felix -

Php version is 5.1.  If I understand correctly, database is MySQL.

magic_quotes_gpc is set to off.

I did see this message in Site Admin - Server - Environment:

"It is required that you store all your data in Unicode format (UTF-8). New installations must be performed into databases that have their default character set as Unicode. If you are upgrading, you should perform the UTF-8 migration process (see the Admin page)."

While all the other settings are marked as "OK" the one for Unicode is flagged as "Check". Would this be something external to a Moodle installation, perhaps set at the server?

Thanks for the assistance!

In reply to Robert Felix

Re: Forum posts add unwanted characters and won't apply the HTML

by Itamar Tzadok -

Yes, you need to access the database to convert it to unicode. See http://docs.moodle.org/22/en/Converting_your_MySQL_database_to_UTF8 for command line approach, or if you have some database management application such as phpmyadmin (which should be available as a moodle local plugin) you could use it instead of command line. smile

Average of ratings: Useful (1)
In reply to Itamar Tzadok

Re: Forum posts add unwanted characters and won't apply the HTML

by Robert Felix -

Thanks again Itamar, I'll look into that next.

Really appreciate your assistance!

In reply to Milli Thornton

Re: Forum posts add unwanted characters and won't apply the HTML

by Robert Felix -

Same here - looks like the tidy filter is disabled already.

In reply to Robert Felix

Re: Forum posts add unwanted characters and won't apply the HTML

by Milli Thornton -

Itamar! I think you figured it out!

My husband said:

After a 10-min chat with Hostmonster tech support, I was able to modify "magic_quotes_gpc " in the ini file.

I made a new forum post right after that and now there are no slashmarks for apostrophes, italics work when applied and the URL I added came through in the post. It appears to be back to normal. smile

Here's what my husband did, for those who use Hostmonster:

Hostmonster CPanel > php config.

Save config settings.

File manager > show hidden files > Download and edit php.ini file.

(See Itamar's post three up in this thread re: how to edit. Basically, I think it's a matter of setting it to off. But check what Itamar said above to be sure.)

Thank you, Itamar! Much appreciated! smile

Thank you also to Mary Cooch. Mary, your questions helped narrow things down and I felt better as soon as you arrived and started assisting us.

Average of ratings: Useful (1)
In reply to Milli Thornton

Re: Forum posts add unwanted characters and won't apply the HTML

by Robert Felix -

Milli, that's great news!  Wondering if the php.ini file got changed somehow.

Now that I look at my php.ini file again, I see that there are two references to magic_quotes_gpc.  The first one is off (as I noted before), but the second one is set to on. That's the one that refers to

; Magic quotes for incoming GET/POST/Cookie data.

Did your husband change need to change this setting in two places?

Hoping this will resolve the issue on my installations too : )

In reply to Robert Felix

Re: Forum posts add unwanted characters and won't apply the HTML

by Milli Thornton -

Bob, I asked my husband. He said to let you know that you will see it twice, but when it shows a semi-colon that's a comment, so not included in the code. Where you need to change it to Off is in the actual code, which doesn't have a semi-colon in front.

Sounds like the second one is the one you need to edit. Good luck! Hope it works for you.

In reply to Milli Thornton

Re: Forum posts add unwanted characters and won't apply the HTML

by Robert Felix -

Thanks Milli!  In the new file,  there is only one place to change it, and in the 5.3 version it is already set to OFF - I see that the setting for magic_quotes_gpc shows up twice in the new file but as your husband mentioned, the first one is only a comment.

In reply to Milli Thornton

Re: Forum posts add unwanted characters and won't apply the HTML

by Steven A -

I had the exact same problem starting today!

Moodle 1.9.13.

Turning off magic_quotes_gpc in the php.ini file fixed the problem.

; Magic quotes for incoming GET/POST/Cookie data.
magic_quotes_gpc = Off

In reply to Steven A

Re: Forum posts add unwanted characters and won't apply the HTML

by Robert Felix -

Steven,

It sounds like changing this setting in my old php.ini file would have fixed the problem.  But I think the Hostmonster tech's recommendation to create a new ini file was a good one. Looks like there are many changes in the new file.

Are you using Hostmonster too?  I didn't see version 1.9.13 available as an install or upgrade option there yet. If you are not using Hostmonster, then I'm puzzled why your forum posts were affected at the same time.

In reply to Robert Felix

Re: Forum posts add unwanted characters and won't apply the HTML

by Steven A -

Hello Bob,

I'm puzzled too.  I'm not with Hostmoster but was experiencing the same problem.  Every time I tried to insert an image using the HTML editor anywhere on my website, the code would break (i.e. backslashes and double quotes would be interested all over the place).  I have no idea why it started.  As far I can tell from my hosting package Control Panel, nothing has changed and the "modified date" of the php.ini was last year (2011).  Regardless, turning off magic_quotes_gpc solved the problem.

In reply to Steven A

Re: Forum posts add unwanted characters and won't apply the HTML

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

Well I go to bed in the Uk and wake up to find you've all been busy figuring it out smile Excellent stuff and thanks Itamar for your technical support (as usual)

In reply to Steven A

Re: Forum posts add unwanted characters and won't apply the HTML

by Robert Felix -

Now that you mention it, I haven't been able to insert an image in a forum post using the HTML editor for a while now. And there were some minor unexplained glitches when I created a new course a few weeks ago, where Moodle is usually solid. So perhaps this issue with the quotes and font styles was just the latest symptom of the larger problem - an out of date php.ini file. My guess is that patches (perhaps some critical) are being released and installed by all the hosting services, causing more symptoms to appear. That would help to explain why the issues are appearing at the same time regardless of the host.

In reply to Milli Thornton

Re: Forum posts add unwanted characters and won't apply the HTML

by Robert Felix -

Milli,

Mine is fixed too!  (Thanks again to Itamar for this suggestion).

Turns out that Hostmonster has upgraded their PHP version to 5.3.  Using PHP Config created a new PHP.INI file, and they suggested going with version 5.3, which I did.  In the new PHP.INI file that was created, magic_quotes_gpc was already set to OFF.

In any case, it looks like what was needed was to replace the old PHP.INI file with a new one, compatible with the update.  Unfortunately when I spoke with a Hostmonster tech support person earlier today, he was not aware of this and told me there hadn't been any changes. The person I just now spoke with, knew exactly what the problem was and how to fix it.

Hope this helps others with the same issue.

In reply to Mary Cooch

Re: Forum posts add unwanted characters and won't apply the HTML

by Amber Starfire -

Hi all, I'm having the same problems, which just showed up on Friday the 27th: backslashes in front of apostrophes, no pictures embedded in posts, and now no ability to save changes for web pages. I'm using 2.0.2 on a Bluehost server.

Update: Bluehost, it turns out, is affiliated with Hostmonster. When I called tech support, all they needed to do was upgrade my PHP.