The default was changed to UTF-8 in PHP 5.4, but diogenes relies on latin1.
{
$mentry = $mcache[$mid];
// echo "pid : $pid, location : $location<br/>";
- $entry = htmlentities(stripslashes($mentry['title']), ENT_QUOTES);
+ $entry = htmlentities(stripslashes($mentry['title']), ENT_QUOTES, "ISO-8859-1");
if ($mentry['pid'])
{
$link = call_user_func($pid_to_url, $mentry['pid']);
$props = $this->props;
$topbar = array ();
- $from = htmlentities($caller->script_uri());
+ $from = htmlentities($caller->script_uri(), ENT_COMPAT | ENT_HTML401, "ISO-8859-1");
if ($props['PID']) {
$hp = $this->barrel->getPID('');
// convert entities.
$text = str_replace("\t", " ", $text);
$text = "<html>\n$text\n</html>";
- $text = htmlentities($text);
+ $text = htmlentities($text, ENT_COMPAT | ENT_HTML401, "ISO-8859-1");
$text = "<pre$css><code$css_html>$text</code></pre>";
} else {
// convert tabs to four spaces,
// convert entities.
$text = str_replace("\t", " ", $text);
- $text = htmlentities($text);
+ $text = htmlentities($text, ENT_COMPAT | ENT_HTML401, "ISO-8859-1");
$text = "<pre$css><code$css_code>$text</code></pre>";
}
return "\n$text\n\n";
}
}
-?>
\ No newline at end of file
+?>
if (isset($_COOKIE['DiogenesLogin']))
$page->assign('username', $_COOKIE['DiogenesLogin']);
- $page->assign('post',htmlentities($page->script_uri()));
+ $page->assign('post',htmlentities($page->script_uri(), ENT_COMPAT | ENT_HTML401, "ISO-8859-1"));
$page->assign('challenge',$this->challenge);
$page->assign('md5',$page->url("md5.js"));
$page->display('login.tpl');
if ($line) {
if (!isset($old) || ($old != $class))
$out .= "<div class=\"$class\">";
- $out .= htmlentities($line);
+ $out .= htmlentities($line, ENT_COMPAT | ENT_HTML401, "ISO-8859-1");
}
$old = $class;
}
foreach($diogenes_db_cache[$cache_id] as $id=>$val)
$html_out .= " <option value=\"$id\"".
($selected==$id ? " selected=\"selected\"":"")
- .">".htmlentities($val)."</option>\n";
+ .">".htmlentities($val, ENT_COMPAT | ENT_HTML401, "ISO-8859-1")."</option>\n";
$html_out .= "</select>\n";
return $html_out;
$lca = preg_split('//', $lc_accent, -1, PREG_SPLIT_NO_EMPTY);
$uca = preg_split('//', $uc_accent, -1, PREG_SPLIT_NO_EMPTY);
foreach($lca as $key=>$val)
- $lch[$key] = htmlentities($val);
+ $lch[$key] = htmlentities($val, ENT_COMPAT | ENT_HTML401, "ISO-8859-1");
foreach($uca as $key=>$val)
- $uch[$key] = htmlentities($val);
+ $uch[$key] = htmlentities($val, ENT_COMPAT | ENT_HTML401, "ISO-8859-1");
$newstring = str_replace($lca,$lch,$string);
$newstring = str_replace($uca,$uch,$newstring);
return $newstring;