mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-03-24 15:24:36 +00:00
Move convertEntities js function into the BackPress scriptloader. Fixes #8505 props sambauers.
git-svn-id: https://develop.svn.wordpress.org/trunk@10086 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -44,6 +44,25 @@ class WP_Scripts extends WP_Dependencies {
|
||||
|
||||
echo "<script type='text/javascript'>\n";
|
||||
echo "/* <![CDATA[ */\n";
|
||||
echo "function convertEntities(o) {\n";
|
||||
echo " var c = function(s) {\n";
|
||||
echo " if (/&[^;]+;/.test(s)) {\n";
|
||||
echo " var e = document.createElement('div');\n";
|
||||
echo " e.innerHTML = s;\n";
|
||||
echo " return !e.firstChild ? s : e.firstChild.nodeValue;\n";
|
||||
echo " }\n";
|
||||
echo " return s;\n";
|
||||
echo " }\n";
|
||||
echo " if ( typeof o === 'string' ) {\n";
|
||||
echo " return c(o);\n";
|
||||
echo " } else if ( typeof o === 'object' ) {\n";
|
||||
echo " for (var v in o) {\n";
|
||||
echo " if ( typeof o[v] === 'string' )\n";
|
||||
echo " o[v] = c(o[v]);\n";
|
||||
echo " }\n";
|
||||
echo " }\n";
|
||||
echo " return o;\n";
|
||||
echo "};\n";
|
||||
echo "\t$object_name = {\n";
|
||||
$eol = '';
|
||||
foreach ( $this->registered[$handle]->extra['l10n'][1] as $var => $val ) {
|
||||
|
||||
Reference in New Issue
Block a user