Test Failed
Push — master ( 3b3a9e...7cd567 )
by Michael
02:25
created
search.php 1 patch
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -32,8 +32,7 @@  discard block
 block discarded – undo
32 32
 
33 33
 if (isset($_SESSION['user'])) {
34 34
 	$sessionuser = $_SESSION['user'];
35
-}
36
-else {
35
+} else {
37 36
 	$sessionuser = "";
38 37
 }
39 38
 
@@ -96,8 +95,7 @@  discard block
 block discarded – undo
96 95
 		$smarty->assign("target", $target);
97 96
         
98 97
 		$smarty->display("search/searchresult.tpl");
99
-	}
100
-	elseif ($_GET['type'] == 'IP') {
98
+	} elseif ($_GET['type'] == 'IP') {
101 99
 		$qterm = '%' . $term . '%';
102 100
         
103 101
 		$statement = gGetDb()->prepare("SELECT * FROM request WHERE email <> '[email protected]' and ip <> '127.0.0.1' and ip LIKE :term or forwardedip LIKE :term2;");
@@ -115,8 +113,7 @@  discard block
 block discarded – undo
115 113
 		$smarty->assign("target", $target);
116 114
         
117 115
 		$smarty->display("search/searchresult.tpl");
118
-	}
119
-	elseif ($_GET['type'] == 'Request') {
116
+	} elseif ($_GET['type'] == 'Request') {
120 117
 		$qterm = '%' . $term . '%';
121 118
         
122 119
 		$statement = gGetDb()->prepare("SELECT * FROM request WHERE name LIKE :term;");
@@ -133,15 +130,13 @@  discard block
 block discarded – undo
133 130
 		$smarty->assign("target", $target);
134 131
         
135 132
 		$smarty->display("search/searchresult.tpl");
136
-	}
137
-	else {
133
+	} else {
138 134
 		BootstrapSkin::displayAlertBox("Unknown search type", "alert-error", "Error");
139 135
 		$smarty->display("search/searchform.tpl");
140 136
 		BootstrapSkin::displayInternalFooter();
141 137
 		die();
142 138
 	}
143
-}
144
-else {
139
+} else {
145 140
 	$smarty->display("search/searchform.tpl");
146 141
 }
147 142
 
Please login to merge, or discard this patch.
zoompage.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -31,8 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
 	if (isset($_GET['ecoverride']) && User::getCurrent()->isAdmin()) {
33 33
 		$smarty->assign('ecoverride', true);
34
-	}
35
-	else {
34
+	} else {
36 35
 		$smarty->assign('ecoverride', false);
37 36
 	}
38 37
         
@@ -79,16 +78,14 @@  discard block
 block discarded – undo
79 78
 	if ($request->getStatus() == "Closed") {
80 79
 		$hash = md5($request->getId() . $request->getEmail() . $request->getTrustedIp() . microtime()); //If the request is closed, change the hash based on microseconds similar to the checksums.
81 80
 		$smarty->assign("isclosed", true);
82
-	}
83
-	else {
81
+	} else {
84 82
 		$hash = md5($request->getId() . $request->getEmail() . $request->getTrustedIp());
85 83
 		$smarty->assign("isclosed", false);
86 84
 	}
87 85
 	$smarty->assign("hash", $hash);
88 86
 	if ($hash == $urlhash) {
89 87
 		$correcthash = true;
90
-	}
91
-	else {
88
+	} else {
92 89
 		$correcthash = false;
93 90
 	}
94 91
 	
@@ -127,8 +124,7 @@  discard block
 block discarded – undo
127 124
 				if (!$ipisprivate) {
128 125
 					$iprdns = $rdnsProvider->getRdns($p2);
129 126
 					$iplocation = $locationProvider->getIpLocation($p2);
130
-				}
131
-				else {
127
+				} else {
132 128
 					// this is going to fail, so why bother trying?
133 129
 					$iprdns = false;
134 130
 					$iplocation = false;
Please login to merge, or discard this patch.
PrecacheGeolocation.php 1 patch
Braces   +5 added lines, -3 removed lines patch added patch discarded remove patch
@@ -69,13 +69,15 @@
 block discarded – undo
69 69
         echo ". IP location fetch complete.\n";
70 70
         $database->commit();
71 71
         echo ". Committed txn.\n";
72
-    } catch (Exception $ex) {
72
+    }
73
+    catch (Exception $ex) {
73 74
         echo ". Encountered exception: " . $ex->getMessage(). "\n";
74 75
         $database->rollBack();
75 76
         echo ". Rolled back txn\n";
76 77
         throw $ex;
77
-    } finally {
78
-        if($database->hasActiveTransaction()){
78
+    }
79
+    finally {
80
+        if($database->hasActiveTransaction()) {
79 81
             $database->rollBack();
80 82
             echo ". Rolled back txn\n";
81 83
         }
Please login to merge, or discard this patch.
index.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -89,8 +89,7 @@  discard block
 block discarded – undo
89 89
 		BootstrapSkin::displayAlertBox($ex->getMessage(), "alert-error", "Unknown error", true, false);
90 90
 		BootstrapSkin::displayPublicFooter();
91 91
 	}
92
-}
93
-else {
92
+} else {
94 93
 	if ($_SERVER['REQUEST_METHOD'] == "POST") {
95 94
 		$errorEncountered = false;
96 95
         
@@ -127,8 +126,7 @@  discard block
 block discarded – undo
127 126
 			}
128 127
             
129 128
 			$smarty->display("request/request-form.tpl");
130
-		}
131
-		else if ($enableEmailConfirm == 1) {
129
+		} else if ($enableEmailConfirm == 1) {
132 130
 			$request->generateEmailConfirmationHash();
133 131
 
134 132
 			$database->transactionally(function() use($request)
@@ -143,8 +141,7 @@  discard block
 block discarded – undo
143 141
 			$request->sendConfirmationEmail();
144 142
             
145 143
 			$smarty->display("request/email-confirmation.tpl");
146
-		}
147
-		else {
144
+		} else {
148 145
 			$request->setEmailConfirm(0); // Since it can't be null
149 146
 			$database->transactionally(function() use($request)
150 147
 			{
@@ -158,8 +155,7 @@  discard block
 block discarded – undo
158 155
 		}
159 156
         
160 157
 		BootstrapSkin::displayPublicFooter();
161
-	}
162
-	else {
158
+	} else {
163 159
 		$smarty->display("request/request-form.tpl");
164 160
 		BootstrapSkin::displayPublicFooter();
165 161
 	}
Please login to merge, or discard this patch.
RecreateTrustedIPs.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,8 +24,7 @@
 block discarded – undo
24 24
 	$hashPos = strpos($rawline, '#');
25 25
 	if ($hashPos !== false) {
26 26
 		$line = substr($rawline, 0, $hashPos);
27
-	}
28
-	else {
27
+	} else {
29 28
 		$line = $rawline;
30 29
 	}
31 30
     
Please login to merge, or discard this patch.
includes/session.php 1 patch
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -69,8 +69,7 @@  discard block
 block discarded – undo
69 69
 
70 70
 					reattachOAuthAccount(User::getCurrent());
71 71
 				}
72
-			}
73
-			else {
72
+			} else {
74 73
 				global $enforceOAuth;
75 74
 
76 75
 				if ($enforceOAuth) {
@@ -83,8 +82,7 @@  discard block
 block discarded – undo
83 82
 			BootstrapSkin::displayAlertBox("I'm sorry, but, your account has not been approved by a site administrator yet. Please stand by.", "alert-error", "New account", true, false);
84 83
 			BootstrapSkin::displayInternalFooter();
85 84
 			die();
86
-		}
87
-		elseif (User::getCurrent()->isSuspended()) {
85
+		} elseif (User::getCurrent()->isSuspended()) {
88 86
 			$database = gGetDb();
89 87
 			$suspendstatement = $database->prepare(<<<SQL
90 88
 SELECT comment 
@@ -105,8 +103,7 @@  discard block
 block discarded – undo
105 103
 			$smarty->display("login/suspended.tpl");
106 104
 			BootstrapSkin::displayInternalFooter();
107 105
 			die();
108
-		}
109
-		elseif (User::getCurrent()->isDeclined()) {
106
+		} elseif (User::getCurrent()->isDeclined()) {
110 107
 			$database = gGetDb();
111 108
 			$suspendstatement = $database->prepare(<<<SQL
112 109
 SELECT comment
@@ -127,11 +124,9 @@  discard block
 block discarded – undo
127 124
 			$smarty->display("login/declined.tpl");
128 125
 			BootstrapSkin::displayInternalFooter();
129 126
 			die();
130
-		}
131
-		elseif ((!User::getCurrent()->isCommunityUser()) && (User::getCurrent()->isUser() || User::getCurrent()->isAdmin())) {
127
+		} elseif ((!User::getCurrent()->isCommunityUser()) && (User::getCurrent()->isUser() || User::getCurrent()->isAdmin())) {
132 128
 			$secure = 1;
133
-		}
134
-		else {
129
+		} else {
135 130
 			//die("Not logged in!");
136 131
 		}
137 132
 	}
Please login to merge, or discard this patch.
includes/PdoDatabase.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -91,8 +91,7 @@  discard block
 block discarded – undo
91 91
 		// all over the rest of the code
92 92
 		if ($this->hasActiveTransaction) {
93 93
 			return false;
94
-		}
95
-		else {
94
+		} else {
96 95
 			// set the transaction isolation level for every transaction.
97 96
 			$this->exec("SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;");
98 97
 
@@ -146,8 +145,7 @@  discard block
 block discarded – undo
146 145
 			// TODO: yuk.
147 146
 			if (defined("PUBLICMODE")) {
148 147
 				BootstrapSkin::displayPublicFooter();
149
-			}
150
-			else {
148
+			} else {
151 149
 				BootstrapSkin::displayInternalFooter();
152 150
 			}
153 151
 
Please login to merge, or discard this patch.
includes/DataObjects/Notification.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -31,12 +31,10 @@  discard block
 block discarded – undo
31 31
 			if ($statement->execute()) {
32 32
 				$this->isNew = false;
33 33
 				$this->id = $this->dbObject->lastInsertId();
34
-			}
35
-			else {
34
+			} else {
36 35
 				throw new Exception($statement->errorInfo());
37 36
 			}
38
-		}
39
-		else {
37
+		} else {
40 38
 			throw new Exception("You shouldn't be doing this...");
41 39
 		}
42 40
 	}
@@ -250,8 +248,7 @@  discard block
 block discarded – undo
250 248
 	{
251 249
 		if ($ban->getDuration() == -1) {
252 250
 			$duration = "indefinitely";
253
-		}
254
-		else {
251
+		} else {
255 252
 			$duration = "until " . date("F j, Y, g:i a", $ban->getDuration());
256 253
 		}
257 254
 
Please login to merge, or discard this patch.
includes/DataObjects/User.php 1 patch
Braces   +8 added lines, -16 removed lines patch added patch discarded remove patch
@@ -46,8 +46,7 @@  discard block
 block discarded – undo
46 46
 		if (self::$currentUser === null) {
47 47
 			if (isset($_SESSION['userID'])) {
48 48
 				self::$currentUser = self::getById($_SESSION['userID'], $database);
49
-			}
50
-			else {
49
+			} else {
51 50
 				$anonymousCoward = new CommunityUser();
52 51
 
53 52
 				self::$currentUser = $anonymousCoward;
@@ -259,12 +258,10 @@  discard block
 block discarded – undo
259 258
 		if ($filter === null) {
260 259
 			$userListQuery = "SELECT username FROM user;";
261 260
 			$userListResult = $database->query($userListQuery);
262
-		}
263
-		elseif ($filter === true) {
261
+		} elseif ($filter === true) {
264 262
 			$userListQuery = "SELECT username FROM user WHERE status IN ('User', 'Admin');";
265 263
 			$userListResult = $database->query($userListQuery);
266
-		}
267
-		else {
264
+		} else {
268 265
 			$userListQuery = "SELECT username FROM user WHERE status = :status;";
269 266
 			$userListResult = $database->prepare($userListQuery);
270 267
 			$userListResult->execute(array(":status" => $filter));
@@ -314,12 +311,10 @@  discard block
 block discarded – undo
314 311
 			if ($statement->execute()) {
315 312
 				$this->isNew = false;
316 313
 				$this->id = (int)$this->dbObject->lastInsertId();
317
-			}
318
-			else {
314
+			} else {
319 315
 				throw new Exception($statement->errorInfo());
320 316
 			}
321
-		}
322
-		else {
317
+		} else {
323 318
 // update
324 319
 			$statement = $this->dbObject->prepare(<<<SQL
325 320
 				UPDATE `user` SET 
@@ -699,8 +694,7 @@  discard block
 block discarded – undo
699 694
 
700 695
 		if ($this->oauthidentitycache == null) {
701 696
 			$this->identityCache = null;
702
-		}
703
-		else {
697
+		} else {
704 698
 			$this->identityCache = unserialize($this->oauthidentitycache);
705 699
 		}
706 700
         
@@ -718,14 +712,12 @@  discard block
 block discarded – undo
718 712
 				) {
719 713
 				// Use cached value - it's either valid or we don't care.
720 714
 				return $this->identityCache;
721
-			}
722
-			else {
715
+			} else {
723 716
 				// Cache expired and not forcing use of cached value
724 717
 				$this->getIdentityCache();
725 718
 				return $this->identityCache;
726 719
 			}
727
-		}
728
-		else {
720
+		} else {
729 721
 			// Cache isn't ours or doesn't exist
730 722
 			$this->getIdentityCache();
731 723
 			return $this->identityCache;
Please login to merge, or discard this patch.