Fix tzo cookie issue and loosen throttle to start at 50.

master
Retro_Guy 4 months ago
parent 182aabfc42
commit 73fd167566

@ -360,7 +360,7 @@ function show_header($head,$group,$local_poster=false) {
if(isset($_COOKIE['tzo'])) {
$offset=$_COOKIE['tzo'];
} else {
$offset=$CONFIG['timezone'];
$offset=intval($CONFIG['timezone']);
}
echo '<div class="np_article_header">';
if ($article_show["Subject"]) echo $text_header["subject"].htmlspecialchars($head->subject)."<br>";

@ -1606,7 +1606,7 @@ $logfile=$logdir.'/newsportal.log';
// $loadrate = allowed article request per second
$loadrate = .15;
$rate = fdiv($_SESSION['views'], (time() - $_SESSION['starttime']));
if (($rate > $loadrate) && ($_SESSION['views'] > 20)) {
if (($rate > $loadrate) && ($_SESSION['views'] > 50)) {
header("HTTP/1.0 429 Too Many Requests");
if(!isset($_SESSION['throttled'])) {
file_put_contents($logfile, "\n".format_log_date()." ".$config_name." Too many requests from ".$_SERVER['REMOTE_ADDR']." throttling", FILE_APPEND);

Loading…
Cancel
Save