// Block prefetch requests
if (isset($_SERVER['HTTP_X_MOZ']) && $_SERVER['HTTP_X_MOZ'] == 'prefetch')
{
    header('HTTP/1.1 403 Prefetching Forbidden');

    // Send no-cache headers
    header('Expires: Thu, 21 Jul 1977 07:30:00 GMT');    // When yours truly first set eyes on this world! :)
    header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
    header('Cache-Control: post-check=0, pre-check=0', false);
    header('Pragma: no-cache');        // For HTTP/1.0 compability

    exit;
}

Explain me, why this is necessary and what is the prefetch requests?
Thanks advance!

2

(6 replies, posted in PunBB 1.2 discussion)

Parpalak, a little offtop. If I wish use the ./include/dblayer/mysql.php in my open-source project, I must leave a comments in it's, that this code in base is from the PunBB project, and that's all?

3

(2 replies, posted in PunBB 1.2 discussion)

Functions:

//
// Equivalent to htmlspecialchars(), but allows &#[0-9]+ (for unicode)
//
function pun_htmlspecialchars($str)
{
    $str = preg_replace('/&(?!#[0-9]+;)/s', '&', $str);
    $str = str_replace(array('<', '>', '"'), array('&lt;', '&gt;', '&quot;'), $str);

    return $str;
}

//
// Equivalent to strlen(), but counts &#[0-9]+ as one character (for unicode)
//
function pun_strlen($str)
{
    return strlen(preg_replace('/&#([0-9]+);/', '!', $str));
}

Looking only at cases where the use UTF-8, I understand it correctly? Or even if use for example Win-1251, they still have meaning (such as if the text is sent in UTF-8) or both?

Tnx!