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)

File:
1 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 ? 
Note: See TracChangeset for help on using the changeset viewer.

Sites map