瀏覽代碼

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

also, don't call dnsbl for local ip addresses
pull/47/head^2
czaks 8 年之前
父節點
當前提交
f24e0f9814
共有 1 個檔案被更改,包括 12 行新增4 行删除
  1. +12
    -4
      inc/functions.php

+ 12
- 4
inc/functions.php 查看文件

@@ -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;



Loading…
取消
儲存