We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32982
    • 674 Posts
    i want to save a content in the frontend with a snippet into in later version of modx i could do but now when i made a form to send the new content it strip the snippet and in my snippet don’t strip it ¿where are the new function who strip the snippets in postback.(is for use in the pageediter snippet)
    i think is a dark post but any help is appreciated
    hi
      Jabiertxof (formerly XYZVISUAL)
      My bussines: http://marker.es
      https://www.youtube.com/user/jabiertxof/videos
      • 22303 MODX Staff
      • 10,725 Posts
      This is an interesting problem. The new code is in index.php and cleanses the URL, preventing js, php, or MODx tags from being sent through any $_REQUEST variable, be it POST or GET. I’m aware of the issue and we are discussing/exploring solutions.
        • 32982
        • 674 Posts
        thanks for telling i surf in the index.php for delete this freature
          Jabiertxof (formerly XYZVISUAL)
          My bussines: http://marker.es
          https://www.youtube.com/user/jabiertxof/videos
          • 22303 MODX Staff
          • 10,725 Posts
          Quote from: xyzvisual at May 08, 2006, 02:56 AM

          thanks for telling i surf in the index.php for delete this freature

          By doing so, you are removing part of the latest security patch. I cannot tell you the full scope of removing just the simple check for MODx tags, but it may be better to find an alternative approach to POSTing and receiving that data, i.e. encoding it before posting, and unencoding it upon reciept of the request. A similar approach will be used to allow the manager to get past mod_security settings that are becoming more and more common, in future releases.
            • 32982
            • 674 Posts
            y want now made a simple plugin who remplace some text whith the name of the snippet but it dont work and if plugin access is only by the manager why it dont parse this values i think is the easy way to made the things you coment but when plugin has the values [! ... dont parse it. Any oter way or sugestion? thanks for your help
              Jabiertxof (formerly XYZVISUAL)
              My bussines: http://marker.es
              https://www.youtube.com/user/jabiertxof/videos
              • 32982
              • 674 Posts
              i find a solution secure for made it... i start developing the idea is a plugin who remplace in document prerender the content of the id whith a button whth a left side whith a id who is a left secure key only for main administrator next the value of the botton whith the name of the snippet and right whith the 2 secure key who is the valuue of the class. From this manner the sistem could be more secure to the instalation and the snippets and plugins could be a good look. while writing this my head show more problems but i investigate if could be a way.hi
                Jabiertxof (formerly XYZVISUAL)
                My bussines: http://marker.es
                https://www.youtube.com/user/jabiertxof/videos
                • 32982
                • 674 Posts
                i made this plugin only send a value in the form hidden who go to the page you want to edit called allow, in the others pages whith allow="" the values principiodecodigo remplaces whith [! and in the second the values findecodigo remplaces whith !]
                hi
                $e = &$modx->Event;
                switch ($e->name) {
                case "OnParseDocument":
                $allow = (isset($_POST[’allow’]))? $_POST[’allow’] : $_GET[’allow’];
                if ($allow==""){
                $content = $modx->documentOutput ;
                $content = str_replace("principiodecodigo","[!",$content);
                $content = str_replace("findecodigo","!]",$content);
                $modx->documentOutput = $content;}
                break;
                default :
                return; // stop here - this is very important.
                break;
                }
                  Jabiertxof (formerly XYZVISUAL)
                  My bussines: http://marker.es
                  https://www.youtube.com/user/jabiertxof/videos
                  • 15826
                  • 160 Posts
                  Javier, could you please explain better how to install this? I tried saving as a plugin called EncodeSnippet and set it to the following system events- Template Svc Event OnParseDocument, Snippets OnSnipFormSave, and Template Variables OnTVFormSave, and got no joy from it, still couldn’t save snippets from the admin area. I ended up using .htaccess to override mod-security, which worked, but is a temporary solution at best. If you could be a bit clearer on how this works, and how it’s set up, I think many of us will benefit. Thank you.
                    "I’d love to change the world but I can’t find the source code . . ."

                    Custom ModX Templates
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    From the code, it looks like the system event is OnParseDocument.
                      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
                      • 32982
                      • 674 Posts
                      yes its like you say on parse document and i think you need to call principodecodigonameofsnippetandparamsfindecodigo
                      or change the plugin whith the start end you want
                      hi
                        Jabiertxof (formerly XYZVISUAL)
                        My bussines: http://marker.es
                        https://www.youtube.com/user/jabiertxof/videos