We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3232
    • 380 Posts
    Been running a site for years without any issues. All of a sudden I am not able to save resources in Modx. It started to happen about two weeks ago. First thing I tried was an upgrade to 2.5 (was running 2.4) and got the same result.

    Looking at the console when a resource is saved I see the following:

    ext-all.js:21 POST http://www.domain.com/connectors/index.php 404 (Not Found)Ext.extend.doFormUpload @ ext-all.js:21Ext.extend.request @ ext-all.js:21Ext.extend.run @ ext-all.js:21(anonymous function) @ ext-base.js:21
    
    index.php:13 The XSS Auditor refused to execute a script in 'http://www.domain.com/connectors/index.php' because its source code was found within the request. The auditor was enabled as the server sent neither an 'X-XSS-Protection' nor 'Content-Security-Policy' header.
    
    VM650:3 Uncaught SyntaxError: Unexpected token <
    


    taking a look at VM650:3 I see the following:

    (
        <!--[if lt IE 10]>
          <p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
        <![endif]-->


    Now the weird part is when I clear the HTML out of all rich text fields within the resource and save it, it saves without a problem.

    I tried uninstalling the tinymce extra and it still behaves the same way. Has anyone experiences something like this before? It's preventing me from making any changes to my site.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      I'd bet that your hosting has changed or updated his mod_security lists.
        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
        • 3232
        • 380 Posts
        Quote from: sottwell at May 06, 2016, 11:29 AM
        I'd bet that your hosting has changed or updated his mod_security lists.

        Thanks sottwell, I talked with the host and nothing has changed recently in regards to mod security.

        I did have cloud flare setup on this domain and have even bypassed it entirely in the DNS settings so that none of those settings would effect the domain but it is still producing this same error.
          • 3749
          • 24,544 Posts
          That "XSS Auditor" message is not from MODX (unless it's new in 2.5.0). It may be something your host has installed that doesn't like the code of the MODX connector index.php.

          If you turn on Chrome dev. tools (Ctrl-shift-i) and watch the Network tab as you save the resource, you can drill down to see the response and get a look at the error that's causing the "Unexpected token <" error. If will include a lot of HTML, but there will be an error message in there somewhere.

          It's also possible that a PHP upgrade is causing the issue.
            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
            • 3232
            • 380 Posts
            Still having this issue. In talking with the host, they insist nothing has changed recently which would cause this. If I use a browser other than Chrome, I no longer get the Audit message in the console but I am getting two errors.

            The first one is a 404 error when trying to access http://www.domain.com/connectors/index.php on save. This response is the standard 404 page HTML.

            The second is a Syntax Error when ext-all.js is trying to parse the above response. Since it is expecting JSON, it totally breaks down.

            I've confirmed that /connectors/index.php is present on the server and has proper permissions. What would cause it to return a 404 on save?
              • 3749
              • 24,544 Posts
              Do you have any plugins attached to OnHandleRequest OnDocFormSave or OnLoadWebDocument?

              Can you save a newly created resource with a Template that has no TVs attached to it?

              When things get desperate, one thing to try is disabling *all* plugins (right-click on them in the tree), then manually delete all files in the core/cache directory before testing.

              If that solves it, you can re-enable the plugins one at a time until you find the culprit.

              The fact that you can save other objects suggests that there's nothing wrong with the connectors/index.php file itself.
                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
                • 3232
                • 380 Posts
                I disabled all plugins and still had the same problem.

                Is there a content/size limit of a resource. In fooling with the content/data, I have narrowed it down to a single character in a rich text field. If I add one/any character to a particular line, it will error out. if I remove the line it saves without a problem.

                I looked at the HTML in the RTE and there is no funny characters or html. It is the strangest thing. not sure why one particular line of an HTML RT field would cause such problems.
                  • 42562
                  • 1,145 Posts
                  What Rich Text Editor are you using?
                    TinymceWrapper: Complete back/frontend content solution.
                    Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
                    5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
                    • 3232
                    • 380 Posts
                    Quote from: donshakespeare at May 12, 2016, 11:36 PM
                    What Rich Text Editor are you using?

                    TinyMCE but even if I disable the plugin, it still behaves the same way so it isn't the plugin that is the cause.
                      • 3232
                      • 380 Posts
                      So I have narrowed it down to a particular word. if the word "video" appears in the content, it cause this problem. once I remove the word, it saves without issue. It is only this one resource that has this issue.

                      Why on earth would the word video cause such problems?