We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10076
    • 1,024 Posts
    Hi,

    I have the same problem with one.com, only recently.
    It not only changes my documents, but also snippets and chuncks and templates. Bassicaly I can not use Modx with one.com.
    Only workaround is that I make everything locally, backup the local database and import it over phpadmin.
    Did the code bobray posted work?

    Frank.
    • Simply tell the host they need to set magic_quotes off by default and all will be right with the world. This is deprecated in PHP 5.3, and putting the code back in to handle this will cause E_DEPRECATED errors on servers with PHP 5.3.
        • 5145
        • 2 Posts
        Hello there,

        As the actual sysadmin at One.com who’s handled the upgradesm, I can say for sure that it is our policy that magic quotes should be turned off for PHP 5.3. If it is not for your domain then that is an error that should be fixed. Before I start a full scale investigation into why it has been turned on for your domain then I need to know which domain we’re talking about. If you send that to me in a private message then I can promise 2 things; 1) that magic quotes will be turned off ASAP and 2) based upon what I find out about why it is enabled erroneously on your domain then I will personally make sure that it won’t happen again if I have anything to say about it.

        Now this thread is a bit old but it was just pointed out to me by someone else.

        Sorry for any inconvenience this has caused you but we’ll fix it if it is still an issue, I promise.

        Your friendly One.com sysadmin
          • 10076
          • 1,024 Posts
          Quote from: Frank at Dec 03, 2009, 09:10 AM

          Hello there,

          As the actual sysadmin at One.com who’s handled the upgradesm, I can say for sure that it is our policy that magic quotes should be turned off for PHP 5.3. If it is not for your domain then that is an error that should be fixed. Before I start a full scale investigation into why it has been turned on for your domain then I need to know which domain we’re talking about. If you send that to me in a private message then I can promise 2 things; 1) that magic quotes will be turned off ASAP and 2) based upon what I find out about why it is enabled erroneously on your domain then I will personally make sure that it won’t happen again if I have anything to say about it.

          Now this thread is a bit old but it was just pointed out to me by someone else.

          Sorry for any inconvenience this has caused you but we’ll fix it if it is still an issue, I promise.

          Your friendly One.com sysadmin

          Hi Chreo.

          A few weeks after contacting support several times, who ensured me that "magic quotes are turned on, company policy". I noticed that they suddenly were turned of and all is fine.

          Tnx, fr.
            • 5145
            • 2 Posts
            I’m please to hear that the issue was resolved. Having magic quotes set to "on" has never been a "company policy" but rather a default in the past. The default was changed to off for PHP 5.3 for three reasons, 1) due to the fact that many PHP scripts is incorrectly only checking PHP version and assuming that magic quotes is off when detecting 5.3 instead of testing the actual value of the magic quotes setting, 2) the feature is deprecated (for very very good reasons) an slated to be removed completely in PHP 6.0 and 3) magic quotes as such encourages sloppy programming and likely creates as many issues as it solves.

            Best Regards
              • 30100
              • 58 Posts
              Thanks for turning magic_quotes off! and thanks for taking the time to answer there.

              The support staff that I was in contact with also said that they would not turn magic_quotes off. I’m hoaping that this will work better in future upgrades of your servers.

              Down below is what the not so helpful support person said to me before (it’s in Swedish), I gave up arguing with this person and make a hack that neutralized magic_quotes instead. Now I can use a real MODx version instead!


              Uppgradering till PHP 5.3 och magic_quotes_gpc : Support - dm
              Added den 10 november 2009 10:16
              Hejsan! Just MODx har jag inte hört något om lösningar på, men där är stora skillnader mellan PHP 5.3 och 5.2. Den största skillnaden är att de har satt massor av funktioner som deprecated som de planerar ta bort i PHP 6.0. Därför måste öerhört mycket uppdateras till att följa den nya mer strömlinjeformade standard som kommer i PHP 6.0 redan nu.

              Med vänlig hälsning / Best Regards

              SUPPORTEN
              ----------------------------------
              One.com

              Web-site: http://www.one.com
              ---------------------------------

              Uppgradering till PHP 5.3 och magic_quotes_gpc : *user*
              Added den 9 november 2009 19:08
              Okej, jag förstår säkerhetsproblematiken kring era servrar om magic quotes skulle vara avstängt och era kunder lägger upp osäker kod. Tackar för svaret. Eftersom ni säger att det alltid varit på så måste det varit något annat än det som förändrades i samband med uppgraderingen för innan dess så fungerade samma kod problemfritt. Får leta vidare efter andra saker som ändrats mellan PHP 5.2 till 5.3. Har ni några tips om vad det kan vara som skiljer från tidigare versioner och speciellt om ni har andra som ni vet använder MODx och har löst problematik med extra \ så vore vi tacksamma för tipsen. Ska höra i MODx forumen för lösningar med magic quotes påslaget.
              Uppgradering till PHP 5.3 och magic_quotes_gpc : Support - dm
              Added den 9 november 2009 10:56
              Hejsan! Det har alltid varit på. Vi har aldrig haft magic quotes avstängt. Vi har ett otal kunder just nu som förlitar sig på det. Vi ser precis som du fram emot 6.0 när vi kan fasa ut det, men just nu måste den stanna på och vi kan inte stänga av det för dig.

              Med vänlig hälsning / Best Regards

              SUPPORTEN
              ----------------------------------
              One.com

              Web-site: http://www.one.com
              ---------------------------------

              Uppgradering till PHP 5.3 och magic_quotes_gpc : *user*
              Added den 8 november 2009 18:18
              Ja, MODx är den senaste versionen (evolution 1.0.2). Problemet är att ni satt magic_quotes_gpc On i php konfigurationen på er/era servrar. Något som ni inte hade innan uppgraderingen och det är även en inställning som de avråder från på php.net (se http://se2.php.net/manual/en/info.configuration.php#ini.magic-quotes-gpc ) då den är föråldrad och är påväg att tas bort från php. Vi skulle vilja ha hjälp med att sätta magic_quotes_gpc till Off. Att sätta php_flag magic_quotes_gpc Off i .htaccess resulterar bara i 500 Internal Server Error och att sätta set_magic_quotes_runtime(false); i php-filerna verkar inte ha någon effekt. Hur gör vi för att stäng av magic quotes då detta gör hela webbplattformen oanvändbar? MODx fungerar alldeles utmärkt på loopias servrar då de har magic_quotes_gpc avstängt. Vore väldigt tacksam för hjälp med detta då er webbtjänst i övrigt fungerat så bra.
              Uppgradering till PHP 5.3 och magic_quotes_gpc : Support - mk
              Added den 7 november 2009 11:46
              Hejsan! Har du provat att uppdatera ditt script till senaste versionen?

              Med vänlig hälsning / Best Regards

              SUPPORTEN
              ----------------------------------
              One.com

              Web-site: http://www.one.com
              ---------------------------------

              Uppgradering till PHP 5.3 och magic_quotes_gpc : *user*
              Added den 6 november 2009 21:06
              På *domain.com* så kör vi en installation av MODx (http://modxcms.com) som har fungerat väldigt bra ihop med era servrar men efter er uppgradering till PHP 5.3 fick vi problem med att när vi sparar ett dokument i CMS-systemet så läggs det till ett \ tecken framför varje " tecken på alla html taggars attribut vilket gör att hela html sidan går sönder. Efter att ha hört mig för i MODx-forumet så verkar detta vara relaterat till en föråldrad funktion magic_quotes_gpc (http://php.net/manual/en/security.magicquotes.php) som ni verkar ha påslagen i er PHP konfiguration. Vore tacksam att få hjälp med detta snarast möjligt. Som jag förstår saken så är detta något som ni slagit på först vid uppgraderingen då MODx har fungerat utan problem hos er tidigare.

                • 30100
                • 58 Posts
                Oh, and by the way, the thing I did to neutrlize magic_quotes when they where set to on was:
                foreach ($_GET as $key => $value) {
                	$_GET[$key] = stripslashes($value);
                }
                foreach ($_POST as $key => $value) {
                	$_POST[$key] = stripslashes($value);
                }
                


                Inside index.php and index-ajax.php and in manager/index.php at the top of each file, ugly solution but it did the trick. I’m glad being able to take it away now.
                • If you are going to be using 5.3 with Evo, you really need to get magic_quotes_gpc turned off for your php configuration; this should be easily doable with a .user.ini file in your root directory. There is functionality in MODx to strip quotes when this is enabled, but it does not work in all environments with 5.3 because of the new deprecated error that is triggered when the checks for this setting are executed.

                  This should get solved for the next release when proper deprecated error handling is implemented.
                    • 12808
                    • 70 Posts
                    foreach ($_GET as $key => $value) {
                    	$_GET[$key] = stripslashes($value);
                    }
                    foreach ($_POST as $key => $value) {
                    	$_POST[$key] = stripslashes($value);
                    }
                    


                    Perfect, thanx man...That’s the only working solution for me...
                      --
                      www.spotkg.com
                      • 3749
                      • 24,544 Posts
                      Quote from: imandic at Jan 05, 2011, 11:19 PM

                      foreach ($_GET as $key => $value) {
                      	$_GET[$key] = stripslashes($value);
                      }
                      foreach ($_POST as $key => $value) {
                      	$_POST[$key] = stripslashes($value);
                      }
                      


                      Perfect, thanx man...That’s the only working solution for me...

                      Note that this may fail if one of the post values is an array, which can happen with FormIt and certain kinds of TVs, for example.

                      I believe this will work in that case:

                      <?php
                      function _stripslashes_deep($value) {
                              $value = is_array($value) ?
                                      array_map('_stripslashes_deep', $value) :
                                      stripslashes($value);
                              return $value;
                      }
                        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