Failed Conditions
Pull Request — master (#1326)
by Nick
60:22 queued 50:08
created
classes/Utility/LibFilter.php 1 patch
Braces   +13 added lines, -6 removed lines patch added patch discarded remove patch
@@ -177,7 +177,8 @@  discard block
 block discarded – undo
177 177
             $data = preg_replace("/<([^>]*?)(?=<|$)/", "<$1>", $data);
178 178
             $data = preg_replace("/(^|>)([^<]*?)(?=>)/", "$1<$2", $data);
179 179
 
180
-        } else {
180
+        }
181
+        else {
181 182
 
182 183
             #
183 184
             # escape stray brackets
@@ -231,7 +232,8 @@  discard block
 block discarded – undo
231 232
                         return '</'.$name.'>';
232 233
                     }
233 234
                 }
234
-            } else {
235
+            }
236
+            else {
235 237
                 return '';
236 238
             }
237 239
         }
@@ -268,7 +270,8 @@  discard block
 block discarded – undo
268 270
                 if (!$ending) {
269 271
                     if (isset($this->tag_counts[$name])) {
270 272
                         $this->tag_counts[$name]++;
271
-                    } else {
273
+                    }
274
+                    else {
272 275
                         $this->tag_counts[$name] = 1;
273 276
                     }
274 277
                 }
@@ -276,7 +279,8 @@  discard block
 block discarded – undo
276 279
                     $ending = ' /';
277 280
                 }
278 281
                 return '<'.$name.$params.$ending.'>';
279
-            } else {
282
+            }
283
+            else {
280 284
                 return '';
281 285
             }
282 286
         }
@@ -285,7 +289,8 @@  discard block
 block discarded – undo
285 289
         if (preg_match("/^!--(.*)--$/si", $data)) {
286 290
             if ($this->strip_comments) {
287 291
                 return '';
288
-            } else {
292
+            }
293
+            else {
289 294
                 return '<'.$data.'>';
290 295
             }
291 296
         }
@@ -324,7 +329,9 @@  discard block
 block discarded – undo
324 329
             while (1) {
325 330
                 $len = strlen($data);
326 331
                 $data = preg_replace("/<({$tags})(\s[^>]*)?(><\\/\\1>|\\/>)/", '', $data);
327
-                if ($len == strlen($data)) break;
332
+                if ($len == strlen($data)) {
333
+                    break;
334
+                }
328 335
             }
329 336
         }
330 337
 
Please login to merge, or discard this patch.
classes/Db/Query.php 1 patch
Braces   +19 added lines, -10 removed lines patch added patch discarded remove patch
@@ -112,7 +112,8 @@  discard block
 block discarded – undo
112 112
 
113 113
                 if (is_int($paramValue)) {
114 114
                     $paramType = \PDO::PARAM_INT;
115
-                } else {
115
+                }
116
+                else {
116 117
                     $paramType = \PDO::PARAM_STR;
117 118
                 }
118 119
 
@@ -121,7 +122,8 @@  discard block
 block discarded – undo
121 122
 
122 123
             $pdoStatement->execute();
123 124
 
124
-        } else {
125
+        }
126
+        else {
125 127
             // Execute the raw query
126 128
             $pdoStatement = $this->conn->query($sql);
127 129
         }
@@ -131,13 +133,16 @@  discard block
 block discarded – undo
131 133
             $this->error($this->conn->errorCode() . ': ' . $this->conn->errorInfo()[2]);
132 134
         }
133 135
 
134
-        if (!$this->success) return;
136
+        if (!$this->success) {
137
+            return;
138
+        }
135 139
 
136 140
         if ( (!$pdoStatement) or (empty($pdoStatement)) ) {
137 141
             // A failed query.
138 142
             $this->success = false;
139 143
 
140
-        } else {
144
+        }
145
+        else {
141 146
 
142 147
             // A successful SELECT, SHOW, EXPLAIN or DESCRIBE query.
143 148
             $this->success = true;
@@ -150,7 +155,8 @@  discard block
 block discarded – undo
150 155
             // Sanity check that lastInsertId() is actually a number, otherwise panic
151 156
             if (is_numeric($this->conn->lastInsertId())) {
152 157
                 $this->insert_id = (int) $this->conn->lastInsertId();
153
-            } else {
158
+            }
159
+            else {
154 160
                 throw new Exception('Last connection ID was not numeric!');
155 161
             }
156 162
             $this->affected_rows = $pdoStatement->rowCount();
@@ -176,8 +182,9 @@  discard block
 block discarded – undo
176 182
 
177 183
     // After SELECT.
178 184
     public function field($row_index, $column_name) {
179
-        if ($this->rows > 0)
180
-            return $this->data[$row_index][$column_name];
185
+        if ($this->rows > 0) {
186
+                    return $this->data[$row_index][$column_name];
187
+        }
181 188
         return "";
182 189
     }
183 190
 
@@ -188,8 +195,9 @@  discard block
 block discarded – undo
188 195
 
189 196
     // After SELECT.
190 197
     public function row($row_index) {
191
-        if ($this->success && $this->rows > 0)
192
-            return $this->data[$row_index];
198
+        if ($this->success && $this->rows > 0) {
199
+                    return $this->data[$row_index];
200
+        }
193 201
         return array();
194 202
     }
195 203
 
@@ -212,7 +220,8 @@  discard block
 block discarded – undo
212 220
                     if ($n == "email" || $n == "password" || $n == "postcode") {
213 221
                         // Don't want to risk this data being displayed on any page.
214 222
                         $html .= "<td>**MASKED**</td>";
215
-                    } else {
223
+                    }
224
+                    else {
216 225
                         $html .= "<td>" . _htmlentities($field) . "</td>";
217 226
                     }
218 227
                 }
Please login to merge, or discard this patch.