fork download
  1. <?php
  2. class XFO{
  3. const DENY = 'DENY';
  4. const SAMEORIGIN = 'SAMEORIGIN';
  5. const ALLOWFROM = 'ALLOW-FROM';
  6.  
  7. public static $allowFrom = array();
  8.  
  9. public static function enable($policy = self::SAMEORIGIN) {
  10. $header = 'X-FRAME-OPTIONS: '. $policy;
  11.  
  12. if($policy === self::ALLOWFROM) {
  13. $header .= ' '.join(', ', self::$allowFrom);
  14. }
  15.  
  16. header($header);
  17. }
  18. }
Success #stdin #stdout 0.02s 52472KB
stdin
Standard input is empty
stdout
Standard output is empty