So I am using the json_encode
function to strip out any malicious script being entered but is there a way I can make an exception as I have a fair amount of data I am copying from word docs and PDF's which have the '-' & ':' characters and if I include those as soon the browser reads one of those characters it stops rendering the string at that point?
My app is set to use UTF8 both in the meta tag and also inside of my config file but also tried including JSON_UNESCAPED_UNICODE
but to no avail...
Here is an example of my full script:
<script>
var iframe = document.getElementById('editor'),
iframedoc = iframe.contentDocument || iframe.contentWindow.document;
iframedoc.body.innerHTML = <?php echo json_encode($row[3]); ?>;
</script>