예제 #1
0
 public static function force_non_ssl()
 {
     Perch::fetch();
     // to define PERCH_SSL
     if (PERCH_SSL) {
         if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') {
             header('Strict-Transport-Security: max-age=0');
             PerchUtil::redirect(PerchUtil::url_to_non_ssl($_SERVER['REQUEST_URI']));
         }
     }
 }
예제 #2
0
 public static function url_to_ssl_if_needed($path)
 {
     if (PERCH_SSL) {
         return PerchUtil::url_to_ssl($path);
     } else {
         return PerchUtil::url_to_non_ssl($path);
     }
 }