Changeset 115881 in spip-zone


Ignore:
Timestamp:
Jul 7, 2019, 10:14:30 AM (2 weeks ago)
Author:
arnaud.berard@…
Message:

oups on devrait pas committer le dimanche

File:
1 edited

Legend:

Unmodified
Added
Removed
  • _plugins_/webfonts/branches/webfonts2/webfonts2_fonctions.php

    r115880 r115881  
    2222function googlefont_request($webfonts,$subsets='',$type='css'){
    2323        $subset = '&subset=' ;
    24     if(is_array($webfonts) && count($webfonts > 0)){
     24    if(is_array($webfonts) && count($webfonts) > 0 ){
    2525        (strlen($subsets)) ? $subset .= $subsets : $subset = '';
    2626        foreach($webfonts as $font){
     
    2828                $fonts[] = urlencode($font['family']).':'.$variants;
    2929        }
    30         $fonts = implode('|',$fonts);
    31         if($type == 'specimen'){
    32                 $request = "https://fonts.google.com/selection?selection.family=$fonts";
    33         }else{
    34                 $request = "https://fonts.googleapis.com/css?family=$fonts".$subset."&display=swap";
    35         }
    36 
    37             return htmlentities($request);
     30        if(isset($fonts)){
     31            $fonts = implode('|',$fonts);
     32                if($type == 'specimen'){
     33                        $request = "https://fonts.google.com/selection?selection.family=$fonts";
     34                }else{
     35                        $request = "https://fonts.googleapis.com/css?family=$fonts".$subset."&display=swap";
     36                }
     37
     38                return htmlentities($request);
     39        }
    3840    }
    3941    return false;
Note: See TracChangeset for help on using the changeset viewer.