Dotclear


Ignore:
Timestamp:
09/09/16 13:30:35 (9 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

PHP 5.3+ : (expr1 ? expr1 : expr2) may be written → (expr1 ?: expr2)

Location:
inc/admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • inc/admin/lib.dc.page.php

    r3326 r3340  
    106106               // Get directives from settings if exist, else set defaults 
    107107               $csp = new ArrayObject(array()); 
    108                $csp['default-src'] = $core->blog->settings->system->csp_admin_default ? $core->blog->settings->system->csp_admin_default : "'self'"; 
    109                $csp['script-src'] = $core->blog->settings->system->csp_admin_script ? $core->blog->settings->system->csp_admin_script : "'self' 'unsafe-inline' 'unsafe-eval'"; 
    110                $csp['style-src'] = $core->blog->settings->system->csp_admin_style ? $core->blog->settings->system->csp_admin_style : "'self' 'unsafe-inline'"; 
    111                $csp['img-src'] = $core->blog->settings->system->csp_admin_img ? $core->blog->settings->system->csp_admin_img : "'self' data: media.dotaddict.org"; 
     108               $csp['default-src'] = $core->blog->settings->system->csp_admin_default ?: "'self'"; 
     109               $csp['script-src'] = $core->blog->settings->system->csp_admin_script ?: "'self' 'unsafe-inline' 'unsafe-eval'"; 
     110               $csp['style-src'] = $core->blog->settings->system->csp_admin_style ?: "'self' 'unsafe-inline'"; 
     111               $csp['img-src'] = $core->blog->settings->system->csp_admin_img ?: "'self' data: media.dotaddict.org"; 
    112112 
    113113               # Cope with blog post preview (via public URL in iframe) 
     
    298298     { 
    299299          global $core; 
    300           $tag = (isset($n['divtag'])&& $n['divtag'])?'div':'p'; 
     300          $tag = (isset($n['divtag']) && $n['divtag']) ? 'div' : 'p'; 
    301301          $ts = ''; 
    302302          if (!isset($n['with_ts']) || ($n['with_ts'] == true)) { 
     
    442442     { 
    443443          global $core; 
    444           $with_home_link = isset($options['home_link'])?$options['home_link']:true; 
    445           $hl = isset($options['hl'])?$options['hl']:true; 
    446           $hl_pos = isset($options['hl_pos'])?$options['hl_pos']:-1; 
     444          $with_home_link = isset($options['home_link']) ? $options['home_link'] : true; 
     445          $hl = isset($options['hl']) ? $options['hl'] : true; 
     446          $hl_pos = isset($options['hl_pos']) ? $options['hl_pos'] : -1; 
    447447          // First item of array elements should be blog's name, System or Plugins 
    448448          $res = '<h2>'.($with_home_link ? 
  • inc/admin/lib.themeconfig.php

    r2660 r3340  
    7171 
    7272          // Eval font size in em (assume base font size in pixels equal to 16) 
    73           if (preg_match('/^([0-9.]+)\s*(%|pt|px|em|ex)?$/',$size,$m)) { 
     73          if (preg_match('/^([0-9.]+)\s*(%|pt|px|em|ex|rem)?$/',$size,$m)) { 
    7474               if (empty($m[2])) { 
    7575                    $m[2] = 'em'; 
     
    144144     public static function adjustFontSize($s) 
    145145     { 
    146           if (preg_match('/^([0-9.]+)\s*(%|pt|px|em|ex)?$/',$s,$m)) { 
     146          if (preg_match('/^([0-9.]+)\s*(%|pt|px|em|ex|rem)?$/',$s,$m)) { 
    147147               if (empty($m[2])) { 
    148148                    $m[2] = 'em'; 
Note: See TracChangeset for help on using the changeset viewer.

Sites map