parent
0204a597c7
commit
d91b86486b
@ -422,6 +422,13 @@ function serendipity_specialchars($string, $flags = null, $encoding = LANG_CHARS
|
||||
$flags = ENT_COMPAT;
|
||||
}
|
||||
}
|
||||
|
||||
if ($encoding == 'LANG_CHARSET') {
|
||||
// if called before LANG_CHARSET is set, we need to set a fallback encoding to not throw a php warning that
|
||||
// would kill s9y blogs sometimes (https://github.com/s9y/Serendipity/issues/236)
|
||||
$encoding = 'UTF-8';
|
||||
}
|
||||
|
||||
return htmlspecialchars($string, $flags, $encoding, $double_encode);
|
||||
}
|
||||
|
||||
@ -438,6 +445,9 @@ function serendipity_entities($string, $flags = null, $encoding = LANG_CHARSET,
|
||||
$flags = ENT_COMPAT;
|
||||
}
|
||||
}
|
||||
if ($encoding == 'LANG_CHARSET') {
|
||||
$encoding = 'UTF-8';
|
||||
}
|
||||
return htmlentities($string, $flags, $encoding, $double_encode);
|
||||
}
|
||||
|
||||
@ -456,6 +466,9 @@ function serendipity_entity_decode($string, $flags = null, $encoding = LANG_CHAR
|
||||
$flags = ENT_COMPAT;
|
||||
}
|
||||
}
|
||||
if ($encoding == 'LANG_CHARSET') {
|
||||
$encoding = 'UTF-8';
|
||||
}
|
||||
return html_entity_decode($string, $flags, $encoding, $double_encode);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user