Search

I’m trying to store JavaScript in the database via a textarea. I’ve wrapped it in a CDATA wrapper to stop it being parsed but storing the code sanitises && operator to &&, even in the CDATA wrapper.

Is there any way to stop this from happening??

When I output my script, it still has && in it.

I have written an extension, JavaScript Textarea to do this

On the displaying front, My Firebug Net panel shows the headers are returning

Content Type: text/html

Any way to get this to return

Content Type: text/javascript

edit: Got this to work using Ashooners Content Type Mappings

I seem to be having a conversation with myself! lol.

@designermonkey

Just FYI, my Content Type Mapping extention is just a fork of Alistair’s (which is the one you linked to) that added Content-Disposition functionality, which I’m not sure you’ll need. You’ll probably want to use his if you aren’t, since he’s probably maintaining it better than I am ;).

edit: Nevermind, I hadn’t realized Alistair had pulled in the content-disposition function.

@ashooner, I’m going to add something similar into my extension, to make sure peeps can output without too many plugins…

Thanks though!

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details