@@ -18,10 +18,12 @@ discard block |
||
18 | 18 | |
19 | 19 | private static function get_router_name() |
20 | 20 | { |
21 | - if(Request::isAJAX()) |
|
22 | - return 'AJAXRouter'; |
|
23 | - if(URLDecode::getURI() == '/sitemap.xml') |
|
24 | - return 'SitemapRouter'; |
|
21 | + if(Request::isAJAX()) { |
|
22 | + return 'AJAXRouter'; |
|
23 | + } |
|
24 | + if(URLDecode::getURI() == '/sitemap.xml') { |
|
25 | + return 'SitemapRouter'; |
|
26 | + } |
|
25 | 27 | |
26 | 28 | switch(URLDecode::getSite()) |
27 | 29 | { |
@@ -75,19 +77,22 @@ discard block |
||
75 | 77 | |
76 | 78 | $redirect_uri = $this->check_for_special_redirect($redirect_uri); |
77 | 79 | |
78 | - if($this->requires_trailing_slash() && substr($redirect_uri, -1) != '/') |
|
79 | - $redirect_uri .= '/'; |
|
80 | + if($this->requires_trailing_slash() && substr($redirect_uri, -1) != '/') { |
|
81 | + $redirect_uri .= '/'; |
|
82 | + } |
|
80 | 83 | |
81 | 84 | if (URLDecode::getHost() == 'waterfalls.jacobemerick.com') { |
82 | 85 | $redirect_uri = 'http://' . (!Loader::isLive() ? 'dev' : 'www') . '.waterfallsofthekeweenaw.com' . $redirect_uri; |
83 | 86 | } |
84 | 87 | |
85 | - if($redirect_uri == URLDecode::getURI()) |
|
86 | - return; |
|
88 | + if($redirect_uri == URLDecode::getURI()) { |
|
89 | + return; |
|
90 | + } |
|
87 | 91 | |
88 | 92 | $controller_check = $redirect_uri; |
89 | - if(substr($redirect_uri, 0, 4) == 'http') |
|
90 | - $controller_check = preg_replace('@^http://([a-z\.]+)@', '', $redirect_uri); |
|
93 | + if(substr($redirect_uri, 0, 4) == 'http') { |
|
94 | + $controller_check = preg_replace('@^http://([a-z\.]+)@', '', $redirect_uri); |
|
95 | + } |
|
91 | 96 | |
92 | 97 | $controller = $this->get_controller($controller_check); |
93 | 98 | if($controller == '/Error404Controller') |
@@ -116,11 +121,13 @@ discard block |
||
116 | 121 | { |
117 | 122 | foreach($this->get_direct_array() as $check) |
118 | 123 | { |
119 | - if($uri == $check->match) |
|
120 | - return "{$this->get_primary_folder()}/{$check->controller}"; |
|
124 | + if($uri == $check->match) { |
|
125 | + return "{$this->get_primary_folder()}/{$check->controller}"; |
|
126 | + } |
|
121 | 127 | |
122 | - if(preg_match("@^{$check->match}$@", $uri)) |
|
123 | - return "{$this->get_primary_folder()}/{$check->controller}"; |
|
128 | + if(preg_match("@^{$check->match}$@", $uri)) { |
|
129 | + return "{$this->get_primary_folder()}/{$check->controller}"; |
|
130 | + } |
|
124 | 131 | } |
125 | 132 | |
126 | 133 | return '/Error404Controller'; |
@@ -128,10 +135,12 @@ discard block |
||
128 | 135 | |
129 | 136 | final private function get_primary_folder() |
130 | 137 | { |
131 | - if(Request::isAjax()) |
|
132 | - return 'ajax'; |
|
133 | - if(URLDecode::getURI() == '/sitemap.xml') |
|
134 | - return 'sitemap'; |
|
138 | + if(Request::isAjax()) { |
|
139 | + return 'ajax'; |
|
140 | + } |
|
141 | + if(URLDecode::getURI() == '/sitemap.xml') { |
|
142 | + return 'sitemap'; |
|
143 | + } |
|
135 | 144 | |
136 | 145 | return URLDecode::getSite(); |
137 | 146 | } |