@@ -18,10 +18,10 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | private static function get_router_name() |
| 20 | 20 | { |
| 21 | - if(Request::isAJAX()) |
|
| 21 | + if (Request::isAJAX()) |
|
| 22 | 22 | return 'AJAXRouter'; |
| 23 | 23 | |
| 24 | - switch(URLDecode::getSite()) |
|
| 24 | + switch (URLDecode::getSite()) |
|
| 25 | 25 | { |
| 26 | 26 | case 'ajax' : |
| 27 | 27 | return 'AjaxRouter'; |
@@ -65,14 +65,14 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | final protected function check_for_redirect($redirect_uri) |
| 67 | 67 | { |
| 68 | - foreach($this->get_redirect_array() as $check) |
|
| 68 | + foreach ($this->get_redirect_array() as $check) |
|
| 69 | 69 | { |
| 70 | 70 | $redirect_uri = preg_replace($check->pattern, $check->replace, $redirect_uri); |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | $redirect_uri = $this->check_for_special_redirect($redirect_uri); |
| 74 | 74 | |
| 75 | - if($this->requires_trailing_slash() && substr($redirect_uri, -1) != '/') |
|
| 75 | + if ($this->requires_trailing_slash() && substr($redirect_uri, -1) != '/') |
|
| 76 | 76 | $redirect_uri .= '/'; |
| 77 | 77 | |
| 78 | 78 | if (URLDecode::getHost() == 'waterfalls.jacobemerick.com') { |
@@ -80,23 +80,23 @@ discard block |
||
| 80 | 80 | $redirect_uri = $protocol . '://' . (!Loader::isLive() ? 'dev' : 'www') . '.waterfallsofthekeweenaw.com' . $redirect_uri; |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | - if($redirect_uri == URLDecode::getURI()) |
|
| 83 | + if ($redirect_uri == URLDecode::getURI()) |
|
| 84 | 84 | return; |
| 85 | 85 | |
| 86 | 86 | $controller_check = $redirect_uri; |
| 87 | - if(substr($redirect_uri, 0, 4) == 'http') { |
|
| 87 | + if (substr($redirect_uri, 0, 4) == 'http') { |
|
| 88 | 88 | $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? 'https' : 'http'; |
| 89 | 89 | $controller_check = preg_replace('@^' . $protocol . '://([a-z\.]+)@', '', $redirect_uri); |
| 90 | 90 | |
| 91 | 91 | $controller = $this->get_controller($controller_check); |
| 92 | - if($controller == '/Error404Controller') |
|
| 92 | + if ($controller == '/Error404Controller') |
|
| 93 | 93 | { |
| 94 | 94 | Loader::loadNew('controller', '/Error404Controller') |
| 95 | 95 | ->activate(); |
| 96 | 96 | exit; |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | - if(substr($redirect_uri, 0, 4) != 'http') |
|
| 99 | + if (substr($redirect_uri, 0, 4) != 'http') |
|
| 100 | 100 | { |
| 101 | 101 | $redirect_uri = substr($redirect_uri, 1); |
| 102 | 102 | $redirect_uri = URLDecode::getBase() . $redirect_uri; |
@@ -113,12 +113,12 @@ discard block |
||
| 113 | 113 | |
| 114 | 114 | final private function get_controller($uri) |
| 115 | 115 | { |
| 116 | - foreach($this->get_direct_array() as $check) |
|
| 116 | + foreach ($this->get_direct_array() as $check) |
|
| 117 | 117 | { |
| 118 | - if($uri == $check->match) |
|
| 118 | + if ($uri == $check->match) |
|
| 119 | 119 | return "{$this->get_primary_folder()}/{$check->controller}"; |
| 120 | 120 | |
| 121 | - if(preg_match("@^{$check->match}$@", $uri)) |
|
| 121 | + if (preg_match("@^{$check->match}$@", $uri)) |
|
| 122 | 122 | return "{$this->get_primary_folder()}/{$check->controller}"; |
| 123 | 123 | } |
| 124 | 124 | |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | |
| 128 | 128 | final private function get_primary_folder() |
| 129 | 129 | { |
| 130 | - if(Request::isAjax()) |
|
| 130 | + if (Request::isAjax()) |
|
| 131 | 131 | return 'ajax'; |
| 132 | 132 | |
| 133 | 133 | return URLDecode::getSite(); |
@@ -18,8 +18,9 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | private static function get_router_name() |
| 20 | 20 | { |
| 21 | - if(Request::isAJAX()) |
|
| 22 | - return 'AJAXRouter'; |
|
| 21 | + if(Request::isAJAX()) {
|
|
| 22 | + return 'AJAXRouter'; |
|
| 23 | + } |
|
| 23 | 24 | |
| 24 | 25 | switch(URLDecode::getSite()) |
| 25 | 26 | { |
@@ -72,16 +73,18 @@ discard block |
||
| 72 | 73 | |
| 73 | 74 | $redirect_uri = $this->check_for_special_redirect($redirect_uri); |
| 74 | 75 | |
| 75 | - if($this->requires_trailing_slash() && substr($redirect_uri, -1) != '/') |
|
| 76 | - $redirect_uri .= '/'; |
|
| 76 | + if($this->requires_trailing_slash() && substr($redirect_uri, -1) != '/') {
|
|
| 77 | + $redirect_uri .= '/'; |
|
| 78 | + } |
|
| 77 | 79 | |
| 78 | 80 | if (URLDecode::getHost() == 'waterfalls.jacobemerick.com') { |
| 79 | 81 | $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? 'https' : 'http'; |
| 80 | 82 | $redirect_uri = $protocol . '://' . (!Loader::isLive() ? 'dev' : 'www') . '.waterfallsofthekeweenaw.com' . $redirect_uri; |
| 81 | 83 | } |
| 82 | 84 | |
| 83 | - if($redirect_uri == URLDecode::getURI()) |
|
| 84 | - return; |
|
| 85 | + if($redirect_uri == URLDecode::getURI()) {
|
|
| 86 | + return; |
|
| 87 | + } |
|
| 85 | 88 | |
| 86 | 89 | $controller_check = $redirect_uri; |
| 87 | 90 | if(substr($redirect_uri, 0, 4) == 'http') { |
@@ -115,11 +118,13 @@ discard block |
||
| 115 | 118 | { |
| 116 | 119 | foreach($this->get_direct_array() as $check) |
| 117 | 120 | { |
| 118 | - if($uri == $check->match) |
|
| 119 | - return "{$this->get_primary_folder()}/{$check->controller}"; |
|
| 121 | + if($uri == $check->match) {
|
|
| 122 | + return "{$this->get_primary_folder()}/{$check->controller}";
|
|
| 123 | + } |
|
| 120 | 124 | |
| 121 | - if(preg_match("@^{$check->match}$@", $uri)) |
|
| 122 | - return "{$this->get_primary_folder()}/{$check->controller}"; |
|
| 125 | + if(preg_match("@^{$check->match}$@", $uri)) {
|
|
| 126 | + return "{$this->get_primary_folder()}/{$check->controller}";
|
|
| 127 | + } |
|
| 123 | 128 | } |
| 124 | 129 | |
| 125 | 130 | return '/Error404Controller'; |
@@ -127,8 +132,9 @@ discard block |
||
| 127 | 132 | |
| 128 | 133 | final private function get_primary_folder() |
| 129 | 134 | { |
| 130 | - if(Request::isAjax()) |
|
| 131 | - return 'ajax'; |
|
| 135 | + if(Request::isAjax()) {
|
|
| 136 | + return 'ajax'; |
|
| 137 | + } |
|
| 132 | 138 | |
| 133 | 139 | return URLDecode::getSite(); |
| 134 | 140 | } |