1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-27 17:00:52 +01:00

optimize out openboard when we don`t need it. a big performance improvement too 🏎

also, don't call dnsbl for local ip addresses
This commit is contained in:
czaks 2016-05-08 14:01:55 +02:00
parent 12e6aba5d4
commit f24e0f9814

View File

@ -556,14 +556,19 @@ function setupBoard($array) {
}
function openBoard($uri) {
global $config, $build_pages;
global $config, $build_pages, $board;
if ($config['try_smarter'])
$build_pages = array();
$board = getBoardInfo($uri);
if ($board) {
setupBoard($board);
// And what if we don't really need to change a board we have opened?
if (isset ($board) && isset ($board['uri']) && $board['uri'] == $uri) {
return true;
}
$b = getBoardInfo($uri);
if ($b) {
setupBoard($b);
if (function_exists('after_open_board')) {
after_open_board();
@ -1759,6 +1764,9 @@ function checkDNSBL() {
if (!isset($_SERVER['REMOTE_ADDR']))
return; // Fix your web server configuration
if (preg_match("/^(::(ffff:)?)?(127\.|192\.168\.|10\.|172\.(1[6-9]|2[0-9]|3[0-1])\.|0\.|255\.)/", $_SERVER['REMOTE_ADDR']))
return; // It's pointless to check for local IP addresses in dnsbls, isn't it?
if (in_array($_SERVER['REMOTE_ADDR'], $config['dnsbl_exceptions']))
return;