Changeset 1879852
- Timestamp:
- 05/23/2018 08:53:16 AM (8 years ago)
- File:
-
- 1 edited
-
dsgvo/trunk/eu-dsgvo-helper.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dsgvo/trunk/eu-dsgvo-helper.php
r1879780 r1879852 4 4 Plugin Name: EU DSGVO Helper 5 5 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 7 7 Author: Eric Marten (@emarten) 8 8 Author URL: https://www.herr-marten.de/ … … 13 13 function dsgvo_mu_plugin_google_webfont($url) 14 14 { 15 if (substr($url,0,2)=="//") 16 { 17 $url="https:".$url; 18 } 15 19 $expire=(60*60*24*30); 16 20 … … 55 59 if (isset($match["url"])) 56 60 { 61 if (substr($match["url"],0,2)=="//") 62 { 63 $match["url"]="https:".$match["url"]; 64 } 57 65 $file_name=basename($match["url"]); 58 66 $font_file=$upload_dir.$file_name; … … 73 81 ob_start(function($html) 74 82 { 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 75 91 $pattern='/'.'(?<line>\<link[\s\S]+?href=[\"\'](?<url>[\s\S]*?)[\"\'][\s\S]*?\>)'.'/'; 76 92 preg_match_all($pattern,$html,$matches,PREG_SET_ORDER);
Note: See TracChangeset
for help on using the changeset viewer.