Dotclear


Ignore:
Timestamp:
08/18/15 21:25:27 (10 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
2.8
Children:
3081:2d7b794a32c3, 3085:b8c98f60c4d7
Message:

Cope with "unknown" scheme in url (ie nor http: neither https: is defined in origin url)

File:
1 edited

Legend:

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

    r3060 r3080  
    947947     } 
    948948 
    949      public static function getPF($file) { 
     949     public static function getPF($file) 
     950     { 
    950951          return $GLOBALS['core']->adminurl->get('load.plugin.file',array('pf' => $file)); 
    951952     } 
    952953 
    953      public static function setXFrameOptions($origin=null) { 
     954     public static function setXFrameOptions($origin = null) 
     955     { 
    954956          if (self::$xframe_loaded) { 
    955957               return; 
     
    957959          if ($origin !== null) { 
    958960               $url = parse_url($origin); 
    959                header(sprintf('X-Frame-Options: %s', is_array($url)?("ALLOW-FROM ".$url['scheme'].'://'.$url['host']):'SAMEORIGIN')); 
     961               header(sprintf('X-Frame-Options: %s',is_array($url) ? 
     962                    ("ALLOW-FROM ".(isset($url['scheme']) ? $url['scheme'].':' : '' ).'//'.$url['host']) : 
     963                    'SAMEORIGIN')); 
    960964          } else { 
    961965               header('X-Frame-Options: SAMEORIGIN'); // FF 3.6.9+ Chrome 4.1+ IE 8+ Safari 4+ Opera 10.5+ 
    962966          } 
    963967          self::$xframe_loaded = true; 
    964  
    965968     } 
    966969} 
Note: See TracChangeset for help on using the changeset viewer.

Sites map