(FIX) Using Google fonts on secure/mixed content website

Phoca Font - rendering external fonts in Joomla! CMS
pjbauer
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 10 Mar 2013, 17:58

(FIX) Using Google fonts on secure/mixed content website

Post by pjbauer »

If you are running a secure website with all or some pages using the https: protocol, the Phoca Google web fonts will not be downloaded for pages using the https: protocol (at least not in Firefox - haven't tried other browsers).

Here's a link from mozilla explaining the problem... https://developer.mozilla.org/en-US/doc ... ed_content

The php code should be fixed so as to allow the browser to decide what protocol to use when accessing the Google website.

To fix this, change line 168 of /plugins/system/phocafont/phocafont.php from...

Code: Select all

$cssOutput = ' <link href="http://fonts.googleapis.com/css?family='.str_replace(' ', '+', $fontData->title). $variant . $subset .'"'
to...

Code: Select all

$cssOutput = ' <link href="//fonts.googleapis.com/css?family='.str_replace(' ', '+', $fontData->title). $variant . $subset .'"'
This solves that problem. 8)
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: (FIX) Using Google fonts on secure/mixed content website

Post by Jan »

Hi, thank you very much for this info, so this seems to solve the problems in Firefox but does it somehow influence other browsers like Chrome or Opera or non standard browsers?

Jan
If you find Phoca extensions useful, please support the project
Post Reply