vico vico -4 years ago 195
CSS Question

Loading Google font in HTTPS, content being blocked

There is a wordpress theme that automatically pulls the option font picked and requests it from google font. when ssl was needed for a few selected pages the font became


Viewing the console log:

[blocked] The page at '' was loaded over HTTPS, but ran insecure content from ',400,500,700,800': this content should also be loaded over HTTPS.

would going into the code and make all requests in https from google font work? Is there some workaround to this?

found the source code... but seems like it is already doing this... could there be a error in the if logic?

$prefix = "http";
if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') $prefix = "https";


if(!in_array($rule_split[0], $this->used_fonts))
$this->extra_output .= "\n<!-- google webfont font replacement -->\n";
$this->extra_output .= '<link id="google_webfont_'.$this->webfont_count.'" rel="stylesheet" type="text/css" href="'.$prefix.'s://'.str_replace(' ','+',$rule_split[0]).$font_weight.'" />';

Answer Source

Edit your theme replacing every occurency of with (mind the s).

Resources that might pose a security risk (such as scripts and fonts) must be loaded through a secure connection when requested in the context of a secured page for an obvious reason: they could have been manipulated along the way.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download