We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7278
    • 6 Posts
    EVO 1.0.0
    WAMPSERVER 2.0 (XAMPP as well)
    Apache 2.2.1
    PHP 5.3.0
    MYSQL 5.1.36
    WIN XP Pro

    I had setup a local site and was working on converting a template. I had left for a few days and came back to work some more today. After making changes I chose SAVE+ContinueEditing. Checked my site and all styling was gone (no css) I took a real quick glance at the template. Chose SAVE+Close and refreshed site, still no CSS. I looked at the template again and noticed that there were extra back slashes EVERYWHERE. I cleaned up the template and tried again - no change. Still no CSS. Looked at template and a single backslash had been inserted anywhere there was a single or double quote mark. I did a SAVE+ContinueEditing and looked again. The single slash multiplied to 3. Repeated and slash multiplied to 7, then 15, then 31, etc...

    <!DOCTYPE html PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"-//W3C//DTD XHTML 1.0 Transitional//EN\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\">
    <html xmlns=\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"http://www.w3.org/1999/xhtml\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\">
    
    <head>
    	<title>[(site_name)] | [*pagetitle*]</title>
    
    	<meta http-equiv=\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"Content-Type\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" content=\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"text/html; charset=iso-8859-1\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" />
    
    	<link rel=\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"stylesheet\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" href=\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"[(base_url)]assets/templates/default/site.css\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" type=\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"text/css\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" media=\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"screen\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" />
            <base href=\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"[(site_url)]\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" />
    
    <!--[if lte IE 6]>
    
      <style type=\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"text/css\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" media=\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"screen, tv, projection\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\">
            body { behavior: url(assets/js/csshover3.htc); } /* hover:anything support */
            #content { margin-left: 22px; } /* to avoid the BMH */
            a,  a:link { border-bottom-style: solid } /* becuase IE just doesn\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'t dot */
      </style>
    
      <script type=\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"text/javascript\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" src=\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"assets/js/sleight.js\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"></script>
    
    <![endif]-->
    
            </head>
    <body>
    
    <div id=\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"page\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\">
    
    
    <div id=\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"header\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\">


    Anyone have any idea what I may have done, what’s going on? I tested with fresh installs using both WAMPSERVER and XAMPP. With default template and others.

    Any help insight greatly appreciated.

    EDIT - behavior same with SAVE+Close and SAVE+AddAnother
      • 12028
      • 152 Posts
      You can try deactivate magic_quotes_gpc in your php.ini file.

      See this for more information: http://il.php.net/manual/en/security.magicquotes.what.php
        - A small step for mankind, so why not take two...

        Working with web production, graphic design/workflow, photo and education - but are trying to get a life in between!
        • 7278
        • 6 Posts
        magic_quotes_gpc was the culprit. I can’t remember why I would have activated in the first place.

        Thanks.
          • 17168
          • 5 Posts
          Any suggestions for Cpanel
            • 33717
            • 2 Posts
            Hey all,

            Am new here so please be gentle. Also very new to web dev but want to learn, so I’ll apologies in advance for any super n00b questions.

            Anyway, tried the link but it no longer works.

            Anyone got a quick tip to disable the magic quotes thingy?

            EDIT: I’m running a local MAMP with PHP5 server on a Mac 10.6.4. My MODx install is Evolution 1.0

            Peace,
            T
            • Go to Applications/MAMP/conf/php(whichever version you’re using)/php.ini and add a line
              magic_quotes_gpc = Off

              Or if a line already exists setting it to = On, change it to = Off.
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 33717
                • 2 Posts
                Quote from: sottwell at Jun 19, 2010, 10:34 AM

                Go to Applications/MAMP/conf/php(whichever version you’re using)/php.ini and add a line
                magic_quotes_gpc = Off

                Or if a line already exists setting it to = On, change it to = Off.

                Thanks you very much. It didn’t work at first, then I thought to restart the MAMP server. I did that and it worked. Happy days...until my next n00b question laugh

                Next time I’ll take care to note that this was an that was previously [solved]. Thanks again
                • Ah, of course! My apologies; you definitely need to restart the Apache server after changing the php.ini file!
                    Studying MODX in the desert - http://sottwell.com
                    Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                    Join the Slack Community - http://modx.org
                    • 34108
                    • 66 Posts
                    Just though I should post on here as I’ve just had the exact same problem but needed a different solution.

                    I tried all the fixes above (and more) for disabling magic quotes but it made no difference. In the end the problem was the PHP version.

                    I had successfully tested the MODx site in question on two different webhosts, one running PHP Version 5.2.10, and the other one running PHP Version 5.2.13. MODx worked fine on both these webhosts with the backslash issue not happening. But as soon as I moved the site to the client’s webhost, which was running PHP Version 5.3.2, the backslashes began appearing in all templates and chunks whenever I edited them.

                    So the problem in my case was the PHP Version the webhosting company was running - PHP 5.3.2.

                    The solution was to have the webhosting company move the client’s website over to a different server that ran PHP Version 5.2.10 (although 5.2.13 probably would have worked fine as well).

                    They did this free of charge but it did take 24 hours to go through, and then the client had to update the nameservers to point to the new domain so that took another few hours. Another option would have been to move the client’s site over to one of the web hosts I knew were running the PHP version we needed but thankfully we didn’t have to do this.

                    Hope this prevents someone else from tearing out their hair smiley

                    Harmony
                      • 15083
                      • 697 Posts
                      why are these things switched on in the latest version of php....it makes no sense to me!