Completed
Push — master ( 5852b3...e99317 )
by Jacob
04:02
created
utility/Mail.class.inc.php 1 patch
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -20,10 +20,11 @@
 block discarded – undo
20 20
 
21 21
 	public function setToAddress($email, $person = null)
22 22
 	{
23
-		if($person)
24
-			$this->to[] = "{$person} <{$email}>";
25
-		else
26
-			$this->to[] = "{$email}";
23
+		if($person) {
24
+					$this->to[] = "{$person} <{$email}>";
25
+		} else {
26
+					$this->to[] = "{$email}";
27
+		}
27 28
 		return $this;
28 29
 	}
29 30
 
Please login to merge, or discard this patch.
controller/lifestream/DefaultListController.class.inc.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,8 +60,9 @@
 block discarded – undo
60 60
 		{
61 61
 			$post_array[] = $this->format_post($post, true);
62 62
 		}
63
-		if(count($post_array) < 1 && URLDecode::getPiece(1) !== 'search')
64
-			$this->eject();
63
+		if(count($post_array) < 1 && URLDecode::getPiece(1) !== 'search') {
64
+					$this->eject();
65
+		}
65 66
 		return $post_array;
66 67
 	}
67 68
 
Please login to merge, or discard this patch.
controller/home/ContactController.class.inc.php 1 patch
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -33,17 +33,21 @@
 block discarded – undo
33 33
 
34 34
 	private function process_form()
35 35
 	{
36
-		if(!Request::hasPost() || Request::getPost('submit') != 'Send Message!')
37
-			return (object) array('display' => 'normal');
36
+		if(!Request::hasPost() || Request::getPost('submit') != 'Send Message!') {
37
+					return (object) array('display' => 'normal');
38
+		}
38 39
 		
39 40
 		Loader::load('utility', 'Validate');
40 41
 		$error_result = array();
41
-		if(!Validate::checkRequest('post', 'name', 'string'))
42
-			$error_result['name'] = 'please enter your name';
43
-		if(!Validate::checkRequest('post', 'email', 'string'))
44
-			$error_result['email'] = 'please enter a valid email';
45
-		if(!Validate::checkRequest('post', 'message', 'string'))
46
-			$error_result['message'] = 'please write a message';
42
+		if(!Validate::checkRequest('post', 'name', 'string')) {
43
+					$error_result['name'] = 'please enter your name';
44
+		}
45
+		if(!Validate::checkRequest('post', 'email', 'string')) {
46
+					$error_result['email'] = 'please enter a valid email';
47
+		}
48
+		if(!Validate::checkRequest('post', 'message', 'string')) {
49
+					$error_result['message'] = 'please write a message';
50
+		}
47 51
 		
48 52
 		$values = (object) array(
49 53
 			'name' => Request::getPost('name'),
Please login to merge, or discard this patch.
controller/lifestream/HomeController.class.inc.php 1 patch
Braces   +15 added lines, -10 removed lines patch added patch discarded remove patch
@@ -38,8 +38,9 @@  discard block
 block discarded – undo
38 38
 	protected function get_page_number()
39 39
 	{
40 40
 		$page = URLDecode::getPiece(2);
41
-		if(isset($page) && is_numeric($page))
42
-			return $page;
41
+		if(isset($page) && is_numeric($page)) {
42
+					return $page;
43
+		}
43 44
 		return 1;
44 45
 	}
45 46
 
@@ -58,25 +59,29 @@  discard block
 block discarded – undo
58 59
 
59 60
 	protected function get_list_next_link()
60 61
 	{
61
-		if($this->page == 1)
62
-			return;
63
-		if($this->page == 2)
64
-			return Loader::getRootUrl('lifestream');
62
+		if($this->page == 1) {
63
+					return;
64
+		}
65
+		if($this->page == 2) {
66
+					return Loader::getRootUrl('lifestream');
67
+		}
65 68
 		return Loader::getRootUrl('lifestream') . 'page/' . ($this->page - 1) . '/';
66 69
 	}
67 70
 
68 71
 	protected function get_list_prev_link()
69 72
 	{
70
-		if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count())
71
-			return;
73
+		if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) {
74
+					return;
75
+		}
72 76
 		return Loader::getRootUrl('lifestream') . 'page/' . ($this->page + 1) . '/';
73 77
 	}
74 78
 
75 79
 	private $total_post_count;
76 80
 	protected function get_total_post_count()
77 81
 	{
78
-		if(!isset($this->total_post_count))
79
-			$this->total_post_count = $this->postRepository->getPostsCount();
82
+		if(!isset($this->total_post_count)) {
83
+					$this->total_post_count = $this->postRepository->getPostsCount();
84
+		}
80 85
 		return $this->total_post_count;
81 86
 	}
82 87
 
Please login to merge, or discard this patch.
controller/lifestream/PostController.class.inc.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -20,15 +20,18 @@
 block discarded – undo
20 20
 		parent::__construct();
21 21
 		
22 22
 		$id = URLDecode::getPiece(2);
23
-		if(!$id || !is_numeric($id))
24
-			$this->eject();
23
+		if(!$id || !is_numeric($id)) {
24
+					$this->eject();
25
+		}
25 26
 		
26 27
 		$post = $this->postRepository->getPostById($id);
27
-		if(!$post)
28
-			$this->eject();
28
+		if(!$post) {
29
+					$this->eject();
30
+		}
29 31
 		
30
-		if(URLDecode::getPiece(1) != $post['type'])
31
-			$this->eject();
32
+		if(URLDecode::getPiece(1) != $post['type']) {
33
+					$this->eject();
34
+		}
32 35
 		
33 36
 		$this->post = $post;
34 37
 	}
Please login to merge, or discard this patch.
controller/lifestream/TagController.class.inc.php 1 patch
Braces   +15 added lines, -10 removed lines patch added patch discarded remove patch
@@ -97,8 +97,9 @@  discard block
 block discarded – undo
97 97
 	protected function get_page_number()
98 98
 	{
99 99
 		$page = URLDecode::getPiece(3);
100
-		if(isset($page) && is_numeric($page))
101
-			return $page;
100
+		if(isset($page) && is_numeric($page)) {
101
+					return $page;
102
+		}
102 103
 		return 1;
103 104
 	}
104 105
 
@@ -117,25 +118,29 @@  discard block
 block discarded – undo
117 118
 
118 119
 	protected function get_list_next_link()
119 120
 	{
120
-		if($this->page == 1)
121
-			return;
122
-		if($this->page == 2)
123
-			return Loader::getRootUrl('lifestream') . $this->tag . '/';
121
+		if($this->page == 1) {
122
+					return;
123
+		}
124
+		if($this->page == 2) {
125
+					return Loader::getRootUrl('lifestream') . $this->tag . '/';
126
+		}
124 127
 		return Loader::getRootUrl('lifestream') . $this->tag . '/page/' . ($this->page - 1) . '/';
125 128
 	}
126 129
 
127 130
 	protected function get_list_prev_link()
128 131
 	{
129
-		if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count())
130
-			return;
132
+		if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) {
133
+					return;
134
+		}
131 135
 		return Loader::getRootUrl('lifestream') . $this->tag . '/page/' . ($this->page + 1) . '/';
132 136
 	}
133 137
 
134 138
 	private $total_post_count;
135 139
 	protected function get_total_post_count()
136 140
 	{
137
-		if(!isset($this->total_post_count))
138
-			$this->total_post_count = $this->postRepository->getPostsByTypeCount($this->tag);
141
+		if(!isset($this->total_post_count)) {
142
+					$this->total_post_count = $this->postRepository->getPostsByTypeCount($this->tag);
143
+		}
139 144
 		return $this->total_post_count;
140 145
 	}
141 146
 
Please login to merge, or discard this patch.
utility/CronController.class.inc.php 1 patch
Braces   +14 added lines, -10 removed lines patch added patch discarded remove patch
@@ -22,8 +22,9 @@  discard block
 block discarded – undo
22 22
 	{
23 23
 		foreach(self::$CRON_ARRAY as $cron => $frequency)
24 24
 		{
25
-			if(!$this->time_to_run($frequency))
26
-				continue;
25
+			if(!$this->time_to_run($frequency)) {
26
+							continue;
27
+			}
27 28
 			
28 29
 			Loader::load('utility', "cron/{$cron}");
29 30
 			$reflection = new ReflectionClass($cron);
@@ -48,18 +49,21 @@  discard block
 block discarded – undo
48 49
 		
49 50
 		foreach($time as $key => $value)
50 51
 		{
51
-			if($value == '*')
52
-				continue;
52
+			if($value == '*') {
53
+							continue;
54
+			}
53 55
 			if(stristr($value, '/'))
54 56
 			{
55 57
 				$value = substr($value, 2);
56
-				if($cur[$key] % $value == 0)
57
-					continue;
58
-				else
59
-					return;
58
+				if($cur[$key] % $value == 0) {
59
+									continue;
60
+				} else {
61
+									return;
62
+				}
60 63
 			}
61
-			if($cur[$key] == $value)
62
-				continue;
64
+			if($cur[$key] == $value) {
65
+							continue;
66
+			}
63 67
 			return;
64 68
 		}
65 69
 		return true;
Please login to merge, or discard this patch.
utility/Header.class.inc.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -133,8 +133,9 @@  discard block
 block discarded – undo
133 133
 
134 134
 	private static function send($array, $gzip = true)
135 135
 	{
136
-		if($gzip)
137
-			self::start_gzipping();
136
+		if($gzip) {
137
+					self::start_gzipping();
138
+		}
138 139
 		
139 140
 		foreach($array as $row)
140 141
 		{
@@ -144,15 +145,17 @@  discard block
 block discarded – undo
144 145
 
145 146
 	private static function get_date($timestamp = false)
146 147
 	{
147
-		if($timestamp == 0)
148
-			$timestamp = time();
148
+		if($timestamp == 0) {
149
+					$timestamp = time();
150
+		}
149 151
 		return gmdate('D, d M Y H:i:s \G\M\T', $timestamp);
150 152
 	}
151 153
 
152 154
 	private static function start_gzipping()
153 155
 	{
154
-		if(!ob_start('ob_gzhandler'))
155
-            ob_start();
156
+		if(!ob_start('ob_gzhandler')) {
157
+		            ob_start();
158
+		}
156 159
 	}
157 160
 
158 161
 }
Please login to merge, or discard this patch.
controller/PageController.class.inc.php 1 patch
Braces   +70 added lines, -53 removed lines patch added patch discarded remove patch
@@ -38,8 +38,9 @@  discard block
 block discarded – undo
38 38
 			'date' => date('Y')));
39 39
 		
40 40
 		Loader::loadInstance('utility', 'Database');
41
-		if(Database::isConnected() === false)
42
-			$this->unavailable();
41
+		if(Database::isConnected() === false) {
42
+					$this->unavailable();
43
+		}
43 44
 	}
44 45
 
45 46
 	protected function get_domain_container()
@@ -96,8 +97,9 @@  discard block
 block discarded – undo
96 97
 				$post->title = "Blogged about {$category}: <a href=\"{$row['url']}\">{$row['title']}</a>.";
97 98
 				$post->comments = $row['comments'];
98 99
 				
99
-				if($format == 'full')
100
-					$post->image = Content::instance('FetchFirstPhoto', $row['body'])->activate(false, 'standard');
100
+				if($format == 'full') {
101
+									$post->image = Content::instance('FetchFirstPhoto', $row['body'])->activate(false, 'standard');
102
+				}
101 103
 			break;
102 104
 			case 'book' :
103 105
 				$row = $bookRepository->getBookById($raw_post['type_id']);
@@ -105,8 +107,9 @@  discard block
 block discarded – undo
105 107
 				$post->type = 'book';
106 108
 				$post->title = "Just finished reading {$row['title']} by {$row['author']}.";
107 109
 				
108
-				if($format == 'full')
109
-					$post->image = "<img alt=\"{$row['title']} by {$row['author']}\" src=\"{$row['image']}\" />";
110
+				if($format == 'full') {
111
+									$post->image = "<img alt=\"{$row['title']} by {$row['author']}\" src=\"{$row['image']}\" />";
112
+				}
110 113
 			break;
111 114
 			case 'distance' :
112 115
 				$row = $distanceRepository->getDistanceById($raw_post['type_id']);
@@ -115,16 +118,16 @@  discard block
 block discarded – undo
115 118
 				if($row['type'] == 'running')
116 119
 				{
117 120
 					$post->title = "Ran {$row['distance']} miles and felt {$row['felt']}.";
118
-					if(strlen($row['message']) > 0)
119
-						$post->title .= " Afterwards, I was all like '{$row['message']}'.";
120
-				}
121
-				else if($row['type'] == 'hiking')
121
+					if(strlen($row['message']) > 0) {
122
+											$post->title .= " Afterwards, I was all like '{$row['message']}'.";
123
+					}
124
+				} else if($row['type'] == 'hiking')
122 125
 				{
123 126
 					$post->title = "Hiked {$row['distance']} miles and felt {$row['felt']}.";
124
-					if(strlen($row['title']) > 0)
125
-						$post->title .= " I was hiking up around the {$row['title']} area.";
126
-				}
127
-                else if ($row['type'] == 'walking') {
127
+					if(strlen($row['title']) > 0) {
128
+											$post->title .= " I was hiking up around the {$row['title']} area.";
129
+					}
130
+				} else if ($row['type'] == 'walking') {
128 131
                     $post->title = "Walked {$row['distance']} miles and felt {$row['felt']}.";
129 132
                 }
130 133
 			break;
@@ -139,10 +142,11 @@  discard block
 block discarded – undo
139 142
 				
140 143
 				$post->type = 'twitter';
141 144
 				
142
-				if($format == 'full')
143
-					$post->title = $row['text_formatted_full'];
144
-				else
145
-					$post->title = $row['text_formatted'];
145
+				if($format == 'full') {
146
+									$post->title = $row['text_formatted_full'];
147
+				} else {
148
+									$post->title = $row['text_formatted'];
149
+				}
146 150
 				
147 151
 				$post->retweets = ($row['is_retweet'] == 0) ? $row['retweets'] : 0;
148 152
 				$post->favorites = ($row['is_retweet'] == 0) ? $row['favorites'] : 0;
@@ -152,13 +156,15 @@  discard block
 block discarded – undo
152 156
 				
153 157
 				$post->type = 'youtube';
154 158
 				
155
-				if($format == 'full')
156
-					$post->title = "Favorited {$row['title']} by {$row['author']} on YouTube.";
157
-				else
158
-					$post->title = "Favorited <a href=\"http://www.youtube.com/watch?feature=player_embedded&v={$row['video_id']}\" rel=\"nofollow\" target=\"_blank\" title=\"{$row['content']}\">{$row['title']}</a> by {$row['author']} on YouTube.";
159
+				if($format == 'full') {
160
+									$post->title = "Favorited {$row['title']} by {$row['author']} on YouTube.";
161
+				} else {
162
+									$post->title = "Favorited <a href=\"http://www.youtube.com/watch?feature=player_embedded&v={$row['video_id']}\" rel=\"nofollow\" target=\"_blank\" title=\"{$row['content']}\">{$row['title']}</a> by {$row['author']} on YouTube.";
163
+				}
159 164
 				
160
-				if($format == 'full')
161
-					$post->embed_code = "<iframe src=\"http://www.youtube.com/embed/{$row['video_id']}?rel=0\" frameborder=\"0\" allowfullscreen></iframe>";
165
+				if($format == 'full') {
166
+									$post->embed_code = "<iframe src=\"http://www.youtube.com/embed/{$row['video_id']}?rel=0\" frameborder=\"0\" allowfullscreen></iframe>";
167
+				}
162 168
 			break;
163 169
 		}
164 170
 		
@@ -187,10 +193,11 @@  discard block
 block discarded – undo
187 193
 		Loader::load('view', '/Head', $this->data_array['head']);
188 194
 		foreach($this->body_view_array as $view)
189 195
 		{
190
-			if(substr($view, 0, 1) == '/')
191
-				Loader::load('view', $view, $this->data_array['body']);
192
-			else
193
-				Loader::load('view', URLDecode::getSite() . '/' . $view, $this->data_array['body']);
196
+			if(substr($view, 0, 1) == '/') {
197
+							Loader::load('view', $view, $this->data_array['body']);
198
+			} else {
199
+							Loader::load('view', URLDecode::getSite() . '/' . $view, $this->data_array['body']);
200
+			}
194 201
 		}
195 202
         
196 203
         if (URLDecode::getSite() == 'waterfalls') {
@@ -199,8 +206,9 @@  discard block
 block discarded – undo
199 206
             Loader::load('view', '/Foot', array('tracking_code' => self::$TRACKING_CODE));
200 207
         }
201 208
 		
202
-		if($view == '/404' || $view == '/503')
203
-			exit;
209
+		if($view == '/404' || $view == '/503') {
210
+					exit;
211
+		}
204 212
 	}
205 213
 
206 214
 	protected function set_header_method($method)
@@ -273,14 +281,16 @@  discard block
 block discarded – undo
273 281
 
274 282
 	protected function eject()
275 283
 	{
276
-		if(get_class($this) !== 'Error404Controller')
277
-			Loader::loadNew('controller', '/Error404Controller')->activate();
284
+		if(get_class($this) !== 'Error404Controller') {
285
+					Loader::loadNew('controller', '/Error404Controller')->activate();
286
+		}
278 287
 	}
279 288
 
280 289
 	protected function unavailable()
281 290
 	{
282
-		if(get_class($this) !== 'Error503Controller')
283
-			Loader::loadNew('controller', '/Error503Controller')->activate();
291
+		if(get_class($this) !== 'Error503Controller') {
292
+					Loader::loadNew('controller', '/Error503Controller')->activate();
293
+		}
284 294
 	}
285 295
 
286 296
 	protected function redirect($uri, $method = 301)
@@ -288,12 +298,14 @@  discard block
 block discarded – undo
288 298
 		switch($method)
289 299
 		{
290 300
 			case 301 :
291
-				if(get_class($this) !== 'Error301Controller')
292
-					Loader::loadNew('controller', '/Error301Controller', array($uri))->activate();
301
+				if(get_class($this) !== 'Error301Controller') {
302
+									Loader::loadNew('controller', '/Error301Controller', array($uri))->activate();
303
+				}
293 304
 				break;
294 305
 			case 303 :
295
-				if(get_class($this) !== 'Error303Controller')
296
-					Loader::loadNew('controller', '/Error303Controller', array($uri))->activate();
306
+				if(get_class($this) !== 'Error303Controller') {
307
+									Loader::loadNew('controller', '/Error303Controller', array($uri))->activate();
308
+				}
297 309
 				break;
298 310
 		}
299 311
 	}
@@ -340,18 +352,19 @@  discard block
 block discarded – undo
340 352
 			$comment_object->url = $comment->url;
341 353
 			$comment_object->trusted = $comment->trusted;
342 354
 			
343
-			if($comment->reply == 0 && Request::getPost('type') == $comment->id)
344
-				$comment_object->errors = $this->comment_errors;
345
-			else
346
-				$comment_object->errors = array();
355
+			if($comment->reply == 0 && Request::getPost('type') == $comment->id) {
356
+							$comment_object->errors = $this->comment_errors;
357
+			} else {
358
+							$comment_object->errors = array();
359
+			}
347 360
 			
348 361
 			if($comment->reply == 0)
349 362
 			{
350 363
 				$comment_object->replies = array();
351 364
 				$comment_array[$comment->id] = $comment_object;
352
-			}
353
-			else
354
-				$comment_array[$comment->reply]->replies[$comment->id] = $comment_object;
365
+			} else {
366
+							$comment_array[$comment->reply]->replies[$comment->id] = $comment_object;
367
+			}
355 368
 		}
356 369
 		
357 370
 		$comment_count = CommentCollector::getCommentCountForURL($site, $path);
@@ -376,22 +389,26 @@  discard block
 block discarded – undo
376 389
 		$commenter->website = '';
377 390
 		
378 391
 		$commenter_cookie = Cookie::instance('Commenter');
379
-		if(!$commenter_cookie->exists())
380
-			return $commenter;
392
+		if(!$commenter_cookie->exists()) {
393
+					return $commenter;
394
+		}
381 395
 		
382 396
 		$commenter_cookie_value = $commenter_cookie->getValue();
383 397
 		$commenter_cookie_value = json_decode($commenter_cookie_value);
384 398
 		
385
-		if($commenter_cookie_value === NULL)
386
-			return $commenter;
399
+		if($commenter_cookie_value === NULL) {
400
+					return $commenter;
401
+		}
387 402
 		
388
-		if(!isset($commenter_cookie_value->name) || !isset($commenter_cookie_value->email))
389
-			return $commenter;
403
+		if(!isset($commenter_cookie_value->name) || !isset($commenter_cookie_value->email)) {
404
+					return $commenter;
405
+		}
390 406
 		
391 407
 		$commenter_object = CommentCollector::getCommenterByFields($commenter_cookie_value->name, $commenter_cookie_value->email, (isset($commenter_cookie_value->website) ? $commenter_cookie_value->website : ''));
392 408
 		
393
-		if($commenter_object === NULL)
394
-			return $commenter;
409
+		if($commenter_object === NULL) {
410
+					return $commenter;
411
+		}
395 412
 		
396 413
 		$commenter->id = $commenter_object->id;
397 414
 		$commenter->name = $commenter_object->name;
Please login to merge, or discard this patch.