1
0

Introduce serendipity_specialchars-wrapper for encoding bug (#236)

PHP 5.4 sets UTF-8 as the default for htmlspecialchars, htmlentities and html_entity_decode. The first two will echo an empty string when given a string with umlauts. This commits introduces serendipity_specialchar-wrapper that are meant to be a temporary solution for the s9y-core until PHP 5.6 fixed the bug, so the native charset option of s9y continues to work.
This commit is contained in:
onli
2014-11-23 23:41:08 +01:00
parent 6c26d1b3f6
commit 92afc37753
50 changed files with 208 additions and 175 deletions

View File

@ -129,7 +129,7 @@ class serendipity_smarty_emulator {
} elseif (function_exists($funcname)) {
return call_user_func($funcname, $params, $this);
} else {
return "<span class='msg_error'>ERROR: " . htmlspecialchars($funcname) . " NOT FOUND.</span>";
return "<span class='msg_error'>ERROR: " . serendipity_specialchars($funcname) . " NOT FOUND.</span>";
}
}
@ -326,7 +326,7 @@ class serendipity_smarty_emulator_xml extends serendipity_smarty_emulator {
$this->assign($val, null, $level + 1);
echo str_repeat("\t", $level) . "</$closekey>\n";
} else {
echo str_repeat("\t", $level) . "<$openkey>" . htmlspecialchars($val) . "</$closekey>\n";
echo str_repeat("\t", $level) . "<$openkey>" . serendipity_specialchars($val) . "</$closekey>\n";
}
}
}