TemplateHelper: improve invalid utf8 handling in hhvm

This commit is contained in:
Denis Sokolov
2014-03-31 07:21:53 +03:00
committed by Denis
parent 5f03095fae
commit 70e23d1c52
2 changed files with 3 additions and 5 deletions
+3 -1
View File
@@ -27,7 +27,9 @@ class TemplateHelper
{
$flags = ENT_QUOTES;
if (defined("ENT_SUBSTITUTE")) {
// HHVM has all constants defined, but only ENT_IGNORE
// works at the moment
if (defined("ENT_SUBSTITUTE") && !defined("HHVM_VERSION")) {
$flags |= ENT_SUBSTITUTE;
} else {
// This is for 5.3.
-4
View File
@@ -39,10 +39,6 @@ class TemplateHelperTest extends TestCase
public function testEscapeBrokenUtf8()
{
if (defined('HHVM_VERSION')) {
return $this->markTestSkipped();
}
// The following includes an illegal utf-8 sequence to test.
// Encoded in base64 to survive possible encoding changes of this file.
$original = base64_decode('VGhpcyBpcyBhbiBpbGxlZ2FsIHV0Zi04IHNlcXVlbmNlOiDD');