We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16885
    • 255 Posts
    Somehow every time I create a new article using the NewsPublisher snippet my input HTML is filtered, tags like <object>, <code> and <blockquote> are stripped - while these are perfectly fine xHTML attributes. I’m not using any RTE (I don’t get why it copies the permissions of my manager account and not a separate for the front-end, but that’s a totally different matter), so it shouldn’t have any parsing if my idea is right; how can I fix this?
      • 42562
      • 1,145 Posts
      This was 7 years ago... but it saved my royal awkwardness today.

      I could not bring myself to think that the culprit was NewsPublisher... but after some acts of hopelessness and unsavoury words ... I decided to dissect the rabbit:

      ourmodx/core/components/newspublisher/model/newspublisher/newspublisher.class.php
      
      $allowedTags = '<object><code><blockquote>
        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.
        • 3749
        • 24,544 Posts
        Hi Don, I'm not sure what you're saying.

        The original code is:

        $allowedTags = '<p><br><a><i><em><b><strong><pre><table><th><td><tr><img><span><div><h1><h2><h3><h4><h5><font><ul><ol><li><dl><dt><dd>';


        You can see why object, code, and blockquote tags are getting stripped, but your proposed solution, if that's what it is, would strip everything *but* those three.

        How about this?

        $allowedTags = '<p><br><a><i><em><b><strong><pre><table><th><td><tr><img><span><div><h1><h2><h3><h4><h5><font><ul><ol><li><dl><dt><dd><object><blockquote><code>';

          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
          • 42562
          • 1,145 Posts
          Sorry, there is an invisible ellipsis to that code. I meant, just add the missing tags.
          $allowedTags = '<object><code><blockquote>...'
            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.
            • 3749
            • 24,544 Posts
            Of course. I should have seen that. wink

            They'll be there in the next version, though it may be a while before it's released.
              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