We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17394
    • 14 Posts
    Dear Modx users,
    I am facing a problem in editing template. I am using gedit to edit my template and copy and paste it to template on Modx. When I save the template, it automatically adds backslash to any backslash or quotes. For example, observe the " marks and the \ addition after I save. This breaks my webpage.

    Actual document lines:
    <!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" xml:lang="EN" lang="EN" dir="ltr">

    Lines after saving the template:
    <!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\" xml:lang=\"EN\" lang=\"EN\" dir=\"ltr\">


    This happens recursively! If I press save button again after saving, it again adds \ to all the existing \ and " in the altered document ( doc that was saved once).

    Two days ago I upgraded to evolution recent version and I am observing this since then.
    Your help is highly appreciated.
    Thank you
      • 3749
      • 24,544 Posts
      That sounds like magic_quotes_gpc in action.

      http://php.net/manual/en/security.magicquotes.php
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 17394
        • 14 Posts
        Hi Bob,
        thanks for your reply,
        Here is my /etc/apache2/php.ini settings. I think I am looking at the right file ..

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

        ; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc.
        magic_quotes_runtime = Off

        ; Use Sybase-style magic quotes (escape ’ with ’’ instead of \’).
        magic_quotes_sybase = Off


        I read that the magic_quotes_gpc is the only one that is on and it is recommended to have it on.
        Nonetheless, I switched it to Off but it had no positive effect.

        I see the backslash being added to all the documents that I save including chunks, TVs, document editor (CKeditor) etc. For now, I was editing the template in phpmyadmin since there is a table for each template in phpmyadmin. But I could not edit my chunks and TVs there as there are no tables in the database. So, I need to fix this problem before I start developing my site again.

        Please let me know what else I could do.
        Thank you
          • 17394
          • 14 Posts
          Hi Bob..
          It worked!! Thanks for pointing out in the right direction. Its working after I restarted apache.
          Thanks a LOT!
            • 3749
            • 24,544 Posts
            Glad you got it sorted. Thanks for reporting back. smiley
              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting