Cleanup code

This commit is contained in:
Giuseppe Criscione 2018-07-16 15:18:01 +02:00
parent d67c103536
commit 628817ebca
2 changed files with 4 additions and 2 deletions

View File

@ -42,6 +42,7 @@ class Template
if (static::$rendering) {
throw new RuntimeException(__METHOD__ . ' not allowed while rendering');
}
$this->vars['page'] = $page;
$this->vars = array_merge($this->vars, $vars);
@ -85,7 +86,9 @@ class Template
if (static::$rendering) {
throw new RuntimeException(__METHOD__ . ' not allowed while rendering');
}
ob_start();
static::$rendering = true;
$this->insert($this->name);
static::$rendering = false;

View File

@ -19,8 +19,7 @@ class Uri
public static function scheme($uri = null)
{
if (is_null($uri)) {
if (isset($_SERVER['HTTPS']) && strtoupper($_SERVER['HTTPS']) !== 'OFF' ||
$_SERVER['SERVER_PORT'] === '443') {
if (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off' || $_SERVER['SERVER_PORT'] == 443) {
return 'https';
}
return 'http';