Esempio n. 1
0
function cloudflare_buffer_init()
{
    // load just the single option, defaulting to on
    $cloudflare_protocol_rewrite = load_protocol_rewrite();
    if ($cloudflare_protocol_rewrite == 1) {
        ob_start('cloudflare_buffer_wrapup');
    }
}
Esempio n. 2
0
function cloudflare_ssl_srcset($sources)
{
    $cloudflare_protocol_rewrite = load_protocol_rewrite();
    if ($cloudflare_protocol_rewrite == 1) {
        foreach ($sources as &$source) {
            $re = "/https?:\\/\\//i";
            $subst = "//";
            $return = preg_replace($re, $subst, $source['url']);
            if ($return) {
                $source['url'] = $return;
            }
        }
        return $sources;
    }
    return $sources;
}