Hi everybody,
I was wondering if someone could help me with some how a strange problem. The site was working normaly until today when I tried to change something in my template and now it seems I can not save it anymore if it includes any piece of code with <script type="text/javascript"></script>? If I copy my template into Template Code (html) and it includes any piece of code with <script type="text/javascript"></script> and click save it shows the saving dialog for a second and then it goes back to editing, if I reload after that it show just this: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " and deletes the whole code I pasted inside.
I am using Modx Revo 2.2.0-pl2 (traditional). I have also tried pasting my code directly into the database in my PHPmyAdmin and it loads for a long time but nothing happens, sometimes I get page not available. O and if I take all of <script type="text/javascript"></script> out of my code it saves normally.
Any suggestions? I am really stuck on this. Thanks in advance for any solution.
[ed. note: zhazhy last edited this post 13 years, 1 month ago.]
-
☆ A M B ☆
- 24,524 Posts
That very much sounds like your hosting provider has set up some kind of security measure to monitor and block content returned in forms. This will simply abort any POST or GET that has words or HTML tags or javascript that the security software has been configured to block. Ask your hosting provider if they've upgraded or installed suhosin or mod_security or something similar, and if they can disable it or modify it for your site, especially for your site Manager.
I have now noticed another wierd behaviour - modx allows me to put and save <script type="text/javascript"></script> if it is anywhere else than between <head></head>. So I can actually save and refresh and it stays the same. Any ideas? Do you think this is still our hosting provider?
It actually doesn t make a difference, I have already tried both ways and also the last one you suggested (the fake function). In my template I am using the first way you suggested and also the second one. I stripped my code of all javascripts from <head></head> and tried to put random ones from my code into the head but as soon as I insert it and save it, it just show the save dialog for a second.
Yeah, it sounds strange for sure.
Who is your provider? If they have forums like this one, they might have someone who has experienced the same thing, assuming it's a host provider issue.
Another place to check is the error logs: MODX (within the manager), PHP and possibly even the web log file.
Hope this helps.
Our host provider is checking this for about an hour now and I think they have not found the problem. Is it possible that it has something to do with the System settings or something like that? I see now that all of my system settings are now showing Last modified Jan 01, 1970 01:00 AM. Is this ok?
I managed to change the code in phpmyadmin now, after that I went into modx which showed me the template with javascripts and when I tried to save it again it was the same thing.
Hi Zhazhy,
You're quite welcome!
Regards,
Tom