@@ -51,8 +51,9 @@ discard block |
||
51 | 51 | { |
52 | 52 | $uri = $_SERVER['REQUEST_URI']; |
53 | 53 | |
54 | - if ($uri === '/') |
|
55 | - return $this::_index; |
|
54 | + if ($uri === '/') { |
|
55 | + return $this::_index; |
|
56 | + } |
|
56 | 57 | |
57 | 58 | $uri = substr($uri, 1); |
58 | 59 | |
@@ -65,8 +66,9 @@ discard block |
||
65 | 66 | $this->redirect(SITE . substr($uri, strlen($this::_global))); |
66 | 67 | } |
67 | 68 | |
68 | - if ($uri[-1] !== '/') |
|
69 | - return $uri; |
|
69 | + if ($uri[-1] !== '/') { |
|
70 | + return $uri; |
|
71 | + } |
|
70 | 72 | |
71 | 73 | $new_uri = substr($uri, 0, -1); |
72 | 74 | $this->redirect(SITE . '/' . $new_uri); |
@@ -9,8 +9,9 @@ |
||
9 | 9 | { |
10 | 10 | $class = get_called_class(); |
11 | 11 | |
12 | - if (!isset(self::$_instances[$class])) |
|
13 | - self::$_instances[$class] = new $class(); |
|
12 | + if (!isset(self::$_instances[$class])) { |
|
13 | + self::$_instances[$class] = new $class(); |
|
14 | + } |
|
14 | 15 | |
15 | 16 | return self::$_instances[$class]; |
16 | 17 | } |
@@ -5,7 +5,7 @@ |
||
5 | 5 | $port = ($_SERVER['SERVER_PORT'] ?? false) === 443; |
6 | 6 | $https = ($_SERVER['HTTPS'] ?? false) === 'on'; |
7 | 7 | |
8 | -define('SITE', (($proto or $port or $https) ? 'https': 'http') . '://' . $_SERVER['SERVER_NAME']); |
|
8 | +define('SITE', (($proto or $port or $https) ? 'https' : 'http') . '://' . $_SERVER['SERVER_NAME']); |
|
9 | 9 | |
10 | 10 | session_start(); |
11 | 11 |
@@ -24,9 +24,9 @@ |
||
24 | 24 | // function by Rakesh Sankar |
25 | 25 | |
26 | 26 | $search = array( |
27 | - '/\>[^\S ]+/s', // strip whitespaces after tags, except space |
|
28 | - '/[^\S ]+\</s', // strip whitespaces before tags, except space |
|
29 | - '/(\s)+/s', // shorten multiple whitespace sequences |
|
27 | + '/\>[^\S ]+/s', // strip whitespaces after tags, except space |
|
28 | + '/[^\S ]+\</s', // strip whitespaces before tags, except space |
|
29 | + '/(\s)+/s', // shorten multiple whitespace sequences |
|
30 | 30 | '/<!--(.|\s)*?-->/' // Remove HTML comments |
31 | 31 | ); |
32 | 32 |