1
0

Patch remaining usages of html_entity_decode

Document
This commit is contained in:
Garvin Hicking
2014-11-24 09:57:47 +01:00
parent 92afc37753
commit 26535ec09c
4 changed files with 10 additions and 15 deletions

View File

@ -2,17 +2,6 @@
@serendipity_plugin_api::load_language(dirname(__FILE__));
if (!function_exists('html_entity_decode')) {
function html_entity_decode($given_html, $quote_style = ENT_QUOTES) {
$trans_table = get_html_translation_table(HTML_SPECIALCHARS, $quote_style);
if ($trans_table["'"] != ''') { # some versions of PHP match single quotes to '
$trans_table["'"] = ''';
}
return (strtr($given_html, array_flip($trans_table)));
}
}
class serendipity_event_xhtmlcleanup extends serendipity_event
{
var $title = PLUGIN_EVENT_XHTMLCLEANUP_NAME;
@ -254,7 +243,7 @@ class serendipity_event_xhtmlcleanup extends serendipity_event
// Reconstruct XHTML tag.
$atts = ' ';
foreach($vals[0]['attributes'] AS $att => $att_con) {
$atts .= strtolower($att) . '="' . ($this->cleanup_parse ? htmlspecialchars($att_con) : $att_con) . '" ';
$atts .= strtolower($att) . '="' . ($this->cleanup_parse ? serendipity_specialchars($att_con) : $att_con) . '" ';
}
return '<' . strtolower($tag) . $atts . ' />';
@ -264,7 +253,7 @@ class serendipity_event_xhtmlcleanup extends serendipity_event
}
function clean_htmlspecialchars($given, $quote_style = ENT_QUOTES) {
return '<' . $given[1] . $given[2] . $given[3] . '=' . $given[4] . htmlspecialchars(html_entity_decode($given[5], $quote_style), $quote_style) . $given[6];
return '<' . $given[1] . $given[2] . $given[3] . '=' . $given[4] . serendipity_specialchars(serendipity_entity_decode($given[5], $quote_style), $quote_style) . $given[6];
}
}