Filter HTML entities when inserting strings with js, includes patch by nbachiyski, fixes #8254

git-svn-id: https://develop.svn.wordpress.org/trunk@9809 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz
2008-11-20 10:54:59 +00:00
parent abecad5356
commit 2f23018db2
3 changed files with 26 additions and 34 deletions

View File

@@ -28,6 +28,20 @@ wp_admin_css( 'css/ie' );
<script type="text/javascript">
//<![CDATA[
addLoadEvent = function(func) {if (typeof jQuery != "undefined") jQuery(document).ready(func); else if (typeof wpOnload!='function'){wpOnload=func;} else {var oldonload=wpOnload; wpOnload=function(){oldonload();func();}}};
function convertEntities(o) {
var p = document.createElement('p');
var c = function(s) { p.innerHTML = s; return p.innerHTML; }
if ( typeof o === 'object' )
for (var v in o)
o[v] = c(o[v]);
else if ( typeof o === 'string' )
return c(o);
p = null;
};
//]]>
</script>
<?php