Ejemplo n.º 1
0
/**
 * Set all headers used by a normal page load.
 */
function http_all_headers()
{
    global $g_bypass_headers;
    if (!$g_bypass_headers && !headers_sent()) {
        http_content_headers();
        http_caching_headers();
        http_security_headers();
        http_custom_headers();
    }
}
Ejemplo n.º 2
0
        break;
    case 'doc':
        # Check if project documentation feature is enabled.
        if (OFF == config_get('enable_project_documentation')) {
            access_denied();
        }
        access_ensure_project_level(config_get('view_proj_doc_threshold'), $v_project_id);
        break;
}
# throw away output buffer contents (and disable it) to protect download
while (@ob_end_clean()) {
}
if (ini_get('zlib.output_compression') && function_exists('ini_set')) {
    ini_set('zlib.output_compression', false);
}
http_security_headers();
# Make sure that IE can download the attachments under https.
header('Pragma: public');
# To fix an IE bug which causes problems when downloading
# attached files via HTTPS, we disable the "Pragma: no-cache"
# command when IE is used over HTTPS.
global $g_allow_file_cache;
if (http_is_protocol_https() && is_browser_internet_explorer()) {
    # Suppress "Pragma: no-cache" header.
} else {
    if (!isset($g_allow_file_cache)) {
        header('Pragma: no-cache');
    }
}
header('Expires: ' . gmdate('D, d M Y H:i:s \\G\\M\\T', time()));
header('Last-Modified: ' . gmdate('D, d M Y H:i:s \\G\\M\\T', $v_date_added));