Skip to content

Commit

Permalink
Fix for utf8 encoding of db values
Browse files Browse the repository at this point in the history
  • Loading branch information
Spine authored and itismadness committed Feb 6, 2019
1 parent 6a9a676 commit 834dc07
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions classes/util.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function display_str($Str) {
if ($Str != '' && !is_number($Str)) {
$Str = Format::make_utf8($Str);
$Str = mb_convert_encoding($Str, 'HTML-ENTITIES', 'UTF-8');
$Str = preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,5};)/m", '&', $Str);
$Str = preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,6};)/m", '&', $Str);

$Replace = array(
"'",'"',"<",">",
Expand Down Expand Up @@ -215,4 +215,4 @@ function unserialize_array($array) {
*/
function isset_array_checked($array, $value) {
return (isset($array[$value])) ? "checked" : "";
}
}
2 changes: 1 addition & 1 deletion sections/user/takemoderate.php
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@

if ($Title != db_string($Cur['Title']) && check_perms('users_edit_titles')) {
// Using the unescaped value for the test to avoid confusion
if (strlen($_POST['Title']) > 1024) {
if (mb_strlen($_POST['Title']) > 1024) {
error("Custom titles have a maximum length of 1,024 characters.");
header("Location: user.php?id=$UserID");
die();
Expand Down

0 comments on commit 834dc07

Please sign in to comment.