Plugin Directory

Changeset 1879852


Ignore:
Timestamp:
05/23/2018 08:53:16 AM (8 years ago)
Author:
emarten
Message:

fixed protocol issues

File:
1 edited

Legend:

Unmodified
Added
Removed
  • dsgvo/trunk/eu-dsgvo-helper.php

    r1879780 r1879852  
    44        Plugin Name: EU DSGVO Helper
    55        Description: This Plugin will be further developed. It so far caches google webfonts locally and replaces youtube embeded videos with a preview-image which becomes an embeded video on-click. More functions will be added soon.
    6         Version: 1.0
     6        Version: 1.0.1
    77        Author: Eric Marten (@emarten)
    88        Author URL: https://www.herr-marten.de/
     
    1313    function dsgvo_mu_plugin_google_webfont($url)
    1414    {
     15        if (substr($url,0,2)=="//")
     16        {
     17            $url="https:".$url;
     18        }
    1519        $expire=(60*60*24*30);
    1620
     
    5559                if (isset($match["url"]))
    5660                {
     61                    if (substr($match["url"],0,2)=="//")
     62                    {
     63                        $match["url"]="https:".$match["url"];
     64                    }
    5765                    $file_name=basename($match["url"]);
    5866                    $font_file=$upload_dir.$file_name;
     
    7381        ob_start(function($html)
    7482        {
     83
     84            $pattern='/'.'(?<line><link[\s\S]*?rel=[\"\']dns-prefetch[\"\'][\s\S]*?href=[\"\'](?<dns>[\s\S]*?)[\"\'][\s\S]*?>)'.'/';
     85            preg_match_all($pattern,$html,$matches,PREG_SET_ORDER);
     86            foreach ($matches as $match)
     87            {
     88                $html=str_replace($match["line"],"",$html);
     89            }
     90
    7591            $pattern='/'.'(?<line>\<link[\s\S]+?href=[\"\'](?<url>[\s\S]*?)[\"\'][\s\S]*?\>)'.'/';
    7692            preg_match_all($pattern,$html,$matches,PREG_SET_ORDER);
Note: See TracChangeset for help on using the changeset viewer.