Completed
Push — master ( ad16ce...5852b3 )
by Jacob
07:53
created
router/Router.class.inc.php 1 patch
Braces   +33 added lines, -22 removed lines patch added patch discarded remove patch
@@ -18,12 +18,15 @@  discard block
 block discarded – undo
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';
25
-		if(URLDecode::getURI() == '/rss/')
26
-			return 'RSSRouter';
21
+		if(Request::isAJAX()) {
22
+					return 'AJAXRouter';
23
+		}
24
+		if(URLDecode::getURI() == '/sitemap.xml') {
25
+					return 'SitemapRouter';
26
+		}
27
+		if(URLDecode::getURI() == '/rss/') {
28
+					return 'RSSRouter';
29
+		}
27 30
 		
28 31
 		switch(URLDecode::getSite())
29 32
 		{
@@ -77,19 +80,22 @@  discard block
 block discarded – undo
77 80
 		
78 81
 		$redirect_uri = $this->check_for_special_redirect($redirect_uri);
79 82
 		
80
-		if($this->requires_trailing_slash() && substr($redirect_uri, -1) != '/')
81
-			$redirect_uri .= '/';
83
+		if($this->requires_trailing_slash() && substr($redirect_uri, -1) != '/') {
84
+					$redirect_uri .= '/';
85
+		}
82 86
 		
83 87
         if (URLDecode::getHost() == 'waterfalls.jacobemerick.com') {
84 88
             $redirect_uri = 'http://' . (!Loader::isLive() ? 'dev' : 'www') . '.waterfallsofthekeweenaw.com' . $redirect_uri;
85 89
         }
86 90
         
87
-		if($redirect_uri == URLDecode::getURI())
88
-			return;
91
+		if($redirect_uri == URLDecode::getURI()) {
92
+					return;
93
+		}
89 94
 		
90 95
 		$controller_check = $redirect_uri;
91
-		if(substr($redirect_uri, 0, 4) == 'http')
92
-			$controller_check = preg_replace('@^http://([a-z\.]+)@', '', $redirect_uri);
96
+		if(substr($redirect_uri, 0, 4) == 'http') {
97
+					$controller_check = preg_replace('@^http://([a-z\.]+)@', '', $redirect_uri);
98
+		}
93 99
 		
94 100
 		$controller = $this->get_controller($controller_check);
95 101
 		if($controller == '/Error404Controller')
@@ -118,11 +124,13 @@  discard block
 block discarded – undo
118 124
 	{
119 125
 		foreach($this->get_direct_array() as $check)
120 126
 		{
121
-			if($uri == $check->match)
122
-				return "{$this->get_primary_folder()}/{$check->controller}";
127
+			if($uri == $check->match) {
128
+							return "{$this->get_primary_folder()}/{$check->controller}";
129
+			}
123 130
 			
124
-			if(preg_match("@^{$check->match}$@", $uri))
125
-				return "{$this->get_primary_folder()}/{$check->controller}";
131
+			if(preg_match("@^{$check->match}$@", $uri)) {
132
+							return "{$this->get_primary_folder()}/{$check->controller}";
133
+			}
126 134
 		}
127 135
 		
128 136
 		return '/Error404Controller';
@@ -130,12 +138,15 @@  discard block
 block discarded – undo
130 138
 
131 139
 	final private function get_primary_folder()
132 140
 	{
133
-		if(Request::isAjax())
134
-			return 'ajax';
135
-		if(URLDecode::getURI() == '/sitemap.xml')
136
-			return 'sitemap';
137
-		if(URLDecode::getURI() == '/rss/')
138
-			return 'rss';
141
+		if(Request::isAjax()) {
142
+					return 'ajax';
143
+		}
144
+		if(URLDecode::getURI() == '/sitemap.xml') {
145
+					return 'sitemap';
146
+		}
147
+		if(URLDecode::getURI() == '/rss/') {
148
+					return 'rss';
149
+		}
139 150
 		
140 151
 		return URLDecode::getSite();
141 152
 	}
Please login to merge, or discard this patch.