We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25663 MODX Staff
    • 12,272 Posts
    The problem with just removing newlines is that half a second in a decent text editor like Textmate restores the formatting, assuming there was fairly valid markup in the first place, by running it through HTML tidy functions.
      Ryan Thrash, MODX Co-Founder
      Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
      • 9130
      • 171 Posts
      I’ve looked around a bit and there are commercial solutions for this like this one and you should be able to combine that with modx.
      On the other hand even with the most elaborate scheme is not very hard to get the html source from the web browser after decryption using some javascript. Its just a question if someone cares enough about the content to spend the resources and do it.
        • 3749
        • 24,544 Posts
        Quote from: rthrash at Apr 05, 2009, 11:07 PM

        The problem with just removing newlines is that half a second in a decent text editor like Textmate restores the formatting, assuming there was fairly valid markup in the first place, by running it through HTML tidy functions.

        Right, but remember that we’re dealing with a somewhat ignorant client here so all the OP needs is something that provides the illusion of protecting the code (kind of like the folks at the airport that will take away a 2" pocket knife but let you carry on a sharpened pencil). wink
          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
          • 30564
          • 60 Posts
          First thanks to all for the contributions. As noted and elegantly summed up by Bob the reality is the no newline is not a secure solution but might relieve the client’s initial concerns, whilst giving time to more fully consider the ramifications.

          I tried the addition of \r and that worked, thank you 0x7b [sorry to hear about your boot problem]. It also, unfortunately caused a mootools accordion panel set to fail  smiley [all open].

          The commercial solution is possibly worth looking at, given that there is a trial [again giving breathing space] so long as no one mentions DOM or uses Firebug.  lipsrsealed

          I did come across a php class which is a ’compressor’ that looked interesting though apparently it requires php5 and the client set-up is still at 4.x http://www.phpclasses.org/browse/package/4338.html I recall there were some obfuscators around for .net & asp but perhaps the lamp community is more realistic about the benefits rolleyes of such an approach.

          Regards
          PS Just ran HTTrack on the commercial site above and now have the full text of the index page, which is protected apparently, on my hard disk.
          PPS Just recalled that I’ve posted a site in the forum, which also uses accordion panes, and wanted to clarify that this discussion is about another client.
            • 3749
            • 24,544 Posts
            Quote from: traveller_ted at Apr 06, 2009, 02:37 AM

            I did come across a php class which is a ’compressor’ that looked interesting though apparently it requires php5 and the client set-up is still at 4.x http://www.phpclasses.org/browse/package/4338.html

            It shouldn’t be too hard to modify that class to run under PHP 4 as a MODx plugin.
              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