Passed
Pull Request — master (#5)
by Cody
03:17
created
classes/db.php 1 patch
Switch Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -24,14 +24,14 @@
 block discarded – undo
24 24
 		$er = error_reporting(E_ALL);
25 25
 
26 26
 		switch (DB_TYPE) {
27
-			case "mysql":
28
-				$this->adapter = new Db_Mysqli();
29
-				break;
30
-			case "pgsql":
31
-				$this->adapter = new Db_Pgsql();
32
-				break;
33
-			default:
34
-				die("Unknown DB_TYPE: " . DB_TYPE);
27
+		case "mysql":
28
+			$this->adapter = new Db_Mysqli();
29
+			break;
30
+		case "pgsql":
31
+			$this->adapter = new Db_Pgsql();
32
+			break;
33
+		default:
34
+			die("Unknown DB_TYPE: " . DB_TYPE);
35 35
 		}
36 36
 
37 37
 		if (!$this->adapter) {
Please login to merge, or discard this patch.
classes/api.php 1 patch
Switch Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -218,16 +218,16 @@  discard block
 block discarded – undo
218 218
 
219 219
 			$override_order = false;
220 220
 			switch (clean($_REQUEST["order_by"])) {
221
-				case "title":
222
-					$override_order = "ttrss_entries.title, date_entered, updated";
223
-					break;
224
-				case "date_reverse":
225
-					$override_order = "score DESC, date_entered, updated";
226
-					$skip_first_id_check = true;
227
-					break;
228
-				case "feed_dates":
229
-					$override_order = "updated DESC";
230
-					break;
221
+			case "title":
222
+				$override_order = "ttrss_entries.title, date_entered, updated";
223
+				break;
224
+			case "date_reverse":
225
+				$override_order = "score DESC, date_entered, updated";
226
+				$skip_first_id_check = true;
227
+				break;
228
+			case "feed_dates":
229
+				$override_order = "updated DESC";
230
+				break;
231 231
 			}
232 232
 
233 233
 			/* do not rely on params below */
@@ -259,32 +259,32 @@  discard block
 block discarded – undo
259 259
 		$set_to = "";
260 260
 
261 261
 		switch ($field_raw) {
262
-			case 0:
263
-				$field = "marked";
264
-				$additional_fields = ",last_marked = NOW()";
265
-				break;
266
-			case 1:
267
-				$field = "published";
268
-				$additional_fields = ",last_published = NOW()";
269
-				break;
270
-			case 2:
271
-				$field = "unread";
272
-				$additional_fields = ",last_read = NOW()";
273
-				break;
274
-			case 3:
275
-				$field = "note";
262
+		case 0:
263
+			$field = "marked";
264
+			$additional_fields = ",last_marked = NOW()";
265
+			break;
266
+		case 1:
267
+			$field = "published";
268
+			$additional_fields = ",last_published = NOW()";
269
+			break;
270
+		case 2:
271
+			$field = "unread";
272
+			$additional_fields = ",last_read = NOW()";
273
+			break;
274
+		case 3:
275
+			$field = "note";
276 276
 		};
277 277
 
278 278
 		switch ($mode) {
279
-			case 1:
280
-				$set_to = "true";
281
-				break;
282
-			case 0:
283
-				$set_to = "false";
284
-				break;
285
-			case 2:
286
-				$set_to = "NOT $field";
287
-				break;
279
+		case 1:
280
+			$set_to = "true";
281
+			break;
282
+		case 0:
283
+			$set_to = "false";
284
+			break;
285
+		case 2:
286
+			$set_to = "NOT $field";
287
+			break;
288 288
 		}
289 289
 
290 290
 		if ($field == "note") $set_to = $this->pdo->quote($data);
Please login to merge, or discard this patch.
classes/backend.php 1 patch
Switch Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -126,14 +126,14 @@
 block discarded – undo
126 126
 										$tmp = '';
127 127
 										foreach (str_split($keys[$i]) as $c) {
128 128
 											switch ($c) {
129
-												case '*':
130
-													$tmp .= __('Shift') . '+';
131
-													break;
132
-												case '^':
133
-													$tmp .= __('Ctrl') . '+';
134
-													break;
135
-												default:
136
-													$tmp .= $c;
129
+											case '*':
130
+												$tmp .= __('Shift') . '+';
131
+												break;
132
+											case '^':
133
+												$tmp .= __('Ctrl') . '+';
134
+												break;
135
+											default:
136
+												$tmp .= $c;
137 137
 											}
138 138
 										}
139 139
 										$keys[$i] = $tmp;
Please login to merge, or discard this patch.
classes/pref/prefs.php 1 patch
Switch Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -170,22 +170,22 @@
 block discarded – undo
170 170
 			$value = $_POST[$pref_name];
171 171
 
172 172
 			switch ($pref_name) {
173
-				case 'DIGEST_PREFERRED_TIME':
174
-					if (get_pref('DIGEST_PREFERRED_TIME') != $value) {
173
+			case 'DIGEST_PREFERRED_TIME':
174
+				if (get_pref('DIGEST_PREFERRED_TIME') != $value) {
175 175
 
176
-						$sth = $this->pdo->prepare("UPDATE ttrss_users SET
176
+					$sth = $this->pdo->prepare("UPDATE ttrss_users SET
177 177
 						last_digest_sent = NULL WHERE id = ?");
178
-						$sth->execute([$_SESSION['uid']]);
178
+					$sth->execute([$_SESSION['uid']]);
179 179
 
180
-					}
181
-					break;
182
-				case 'USER_LANGUAGE':
183
-					if (!$need_reload) $need_reload = $_SESSION["language"] != $value;
184
-					break;
185
-
186
-				case 'USER_CSS_THEME':
187
-					if (!$need_reload) $need_reload = get_pref($pref_name) != $value;
188
-					break;
180
+				}
181
+				break;
182
+			case 'USER_LANGUAGE':
183
+				if (!$need_reload) $need_reload = $_SESSION["language"] != $value;
184
+				break;
185
+
186
+			case 'USER_CSS_THEME':
187
+				if (!$need_reload) $need_reload = get_pref($pref_name) != $value;
188
+				break;
189 189
 			}
190 190
 
191 191
 			set_pref($pref_name, $value);
Please login to merge, or discard this patch.
classes/pref/feeds.php 1 patch
Switch Indentation   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -1066,70 +1066,70 @@
 block discarded – undo
1066 1066
 				$qpart = "";
1067 1067
 
1068 1068
 				switch ($k) {
1069
-					case "title":
1070
-						$qpart = "title = " . $this->pdo->quote($feed_title);
1071
-						break;
1072
-
1073
-					case "feed_url":
1074
-						$qpart = "feed_url = " . $this->pdo->quote($feed_url);
1075
-						break;
1076
-
1077
-					case "update_interval":
1078
-						$qpart = "update_interval = " . $this->pdo->quote($upd_intl);
1079
-						break;
1080
-
1081
-					case "purge_interval":
1082
-						$qpart = "purge_interval =" . $this->pdo->quote($purge_intl);
1083
-						break;
1084
-
1085
-					case "auth_login":
1086
-						$qpart = "auth_login = " . $this->pdo->quote($auth_login);
1087
-						break;
1088
-
1089
-					case "auth_pass":
1090
-						$qpart = "auth_pass =" . $this->pdo->quote($auth_pass). ", auth_pass_encrypted = false";
1091
-						break;
1092
-
1093
-					case "private":
1094
-						$qpart = "private = " . $this->pdo->quote($private);
1095
-						break;
1096
-
1097
-					case "include_in_digest":
1098
-						$qpart = "include_in_digest = " . $this->pdo->quote($include_in_digest);
1099
-						break;
1100
-
1101
-					case "always_display_enclosures":
1102
-						$qpart = "always_display_enclosures = " . $this->pdo->quote($always_display_enclosures);
1103
-						break;
1104
-
1105
-					case "mark_unread_on_update":
1106
-						$qpart = "mark_unread_on_update = " . $this->pdo->quote($mark_unread_on_update);
1107
-						break;
1108
-
1109
-					case "cache_images":
1110
-						$qpart = "cache_images = " . $this->pdo->quote($cache_images);
1111
-						break;
1112
-
1113
-					case "hide_images":
1114
-						$qpart = "hide_images = " . $this->pdo->quote($hide_images);
1115
-						break;
1116
-
1117
-					case "cat_id":
1118
-						if (get_pref('ENABLE_FEED_CATS')) {
1119
-							if ($cat_id) {
1120
-								$qpart = "cat_id = " . $this->pdo->quote($cat_id);
1121
-							} else {
1122
-								$qpart = 'cat_id = NULL';
1123
-							}
1069
+				case "title":
1070
+					$qpart = "title = " . $this->pdo->quote($feed_title);
1071
+					break;
1072
+
1073
+				case "feed_url":
1074
+					$qpart = "feed_url = " . $this->pdo->quote($feed_url);
1075
+					break;
1076
+
1077
+				case "update_interval":
1078
+					$qpart = "update_interval = " . $this->pdo->quote($upd_intl);
1079
+					break;
1080
+
1081
+				case "purge_interval":
1082
+					$qpart = "purge_interval =" . $this->pdo->quote($purge_intl);
1083
+					break;
1084
+
1085
+				case "auth_login":
1086
+					$qpart = "auth_login = " . $this->pdo->quote($auth_login);
1087
+					break;
1088
+
1089
+				case "auth_pass":
1090
+					$qpart = "auth_pass =" . $this->pdo->quote($auth_pass). ", auth_pass_encrypted = false";
1091
+					break;
1092
+
1093
+				case "private":
1094
+					$qpart = "private = " . $this->pdo->quote($private);
1095
+					break;
1096
+
1097
+				case "include_in_digest":
1098
+					$qpart = "include_in_digest = " . $this->pdo->quote($include_in_digest);
1099
+					break;
1100
+
1101
+				case "always_display_enclosures":
1102
+					$qpart = "always_display_enclosures = " . $this->pdo->quote($always_display_enclosures);
1103
+					break;
1104
+
1105
+				case "mark_unread_on_update":
1106
+					$qpart = "mark_unread_on_update = " . $this->pdo->quote($mark_unread_on_update);
1107
+					break;
1108
+
1109
+				case "cache_images":
1110
+					$qpart = "cache_images = " . $this->pdo->quote($cache_images);
1111
+					break;
1112
+
1113
+				case "hide_images":
1114
+					$qpart = "hide_images = " . $this->pdo->quote($hide_images);
1115
+					break;
1116
+
1117
+				case "cat_id":
1118
+					if (get_pref('ENABLE_FEED_CATS')) {
1119
+						if ($cat_id) {
1120
+							$qpart = "cat_id = " . $this->pdo->quote($cat_id);
1124 1121
 						} else {
1125
-							$qpart = "";
1122
+							$qpart = 'cat_id = NULL';
1126 1123
 						}
1124
+					} else {
1125
+						$qpart = "";
1126
+					}
1127 1127
 
1128
-						break;
1128
+					break;
1129 1129
 
1130
-					case "feed_language":
1131
-						$qpart = "feed_language = " . $this->pdo->quote($feed_language);
1132
-						break;
1130
+				case "feed_language":
1131
+					$qpart = "feed_language = " . $this->pdo->quote($feed_language);
1132
+					break;
1133 1133
 
1134 1134
 				}
1135 1135
 
Please login to merge, or discard this patch.
classes/rssutils.php 1 patch
Switch Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -1349,35 +1349,35 @@
 block discarded – undo
1349 1349
 					continue;
1350 1350
 
1351 1351
 				switch ($rule["type"]) {
1352
-					case "title":
1353
-						$match = @preg_match("/$reg_exp/iu", $title);
1354
-						break;
1355
-					case "content":
1356
-						// we don't need to deal with multiline regexps
1357
-						$content = preg_replace("/[\r\n\t]/", "", $content);
1352
+				case "title":
1353
+					$match = @preg_match("/$reg_exp/iu", $title);
1354
+					break;
1355
+				case "content":
1356
+					// we don't need to deal with multiline regexps
1357
+					$content = preg_replace("/[\r\n\t]/", "", $content);
1358 1358
 
1359
-						$match = @preg_match("/$reg_exp/iu", $content);
1360
-						break;
1361
-					case "both":
1362
-						// we don't need to deal with multiline regexps
1363
-						$content = preg_replace("/[\r\n\t]/", "", $content);
1359
+					$match = @preg_match("/$reg_exp/iu", $content);
1360
+					break;
1361
+				case "both":
1362
+					// we don't need to deal with multiline regexps
1363
+					$content = preg_replace("/[\r\n\t]/", "", $content);
1364 1364
 
1365
-						$match = (@preg_match("/$reg_exp/iu", $title) || @preg_match("/$reg_exp/iu", $content));
1366
-						break;
1367
-					case "link":
1368
-						$match = @preg_match("/$reg_exp/iu", $link);
1369
-						break;
1370
-					case "author":
1371
-						$match = @preg_match("/$reg_exp/iu", $author);
1372
-						break;
1373
-					case "tag":
1374
-						foreach ($tags as $tag) {
1375
-							if (@preg_match("/$reg_exp/iu", $tag)) {
1376
-								$match = true;
1377
-								break;
1378
-							}
1365
+					$match = (@preg_match("/$reg_exp/iu", $title) || @preg_match("/$reg_exp/iu", $content));
1366
+					break;
1367
+				case "link":
1368
+					$match = @preg_match("/$reg_exp/iu", $link);
1369
+					break;
1370
+				case "author":
1371
+					$match = @preg_match("/$reg_exp/iu", $author);
1372
+					break;
1373
+				case "tag":
1374
+					foreach ($tags as $tag) {
1375
+						if (@preg_match("/$reg_exp/iu", $tag)) {
1376
+							$match = true;
1377
+							break;
1379 1378
 						}
1380
-						break;
1379
+					}
1380
+					break;
1381 1381
 				}
1382 1382
 
1383 1383
 				if ($rule_inverse) $match = !$match;
Please login to merge, or discard this patch.
classes/handler/public.php 1 patch
Switch Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -760,24 +760,24 @@
 block discarded – undo
760 760
 				$feed_urls = false;
761 761
 
762 762
 				switch ($rc['code']) {
763
-					case 0:
764
-						print_warning(T_sprintf("Already subscribed to <b>%s</b>.", $feed_url));
765
-						break;
766
-					case 1:
767
-						print_notice(T_sprintf("Subscribed to <b>%s</b>.", $feed_url));
768
-						break;
769
-					case 2:
770
-						print_error(T_sprintf("Could not subscribe to <b>%s</b>.", $feed_url));
771
-						break;
772
-					case 3:
773
-						print_error(T_sprintf("No feeds found in <b>%s</b>.", $feed_url));
774
-						break;
775
-					case 4:
776
-						$feed_urls = $rc["feeds"];
777
-						break;
778
-					case 5:
779
-						print_error(T_sprintf("Could not subscribe to <b>%s</b>.<br>Can't download the Feed URL.", $feed_url));
780
-						break;
763
+				case 0:
764
+					print_warning(T_sprintf("Already subscribed to <b>%s</b>.", $feed_url));
765
+					break;
766
+				case 1:
767
+					print_notice(T_sprintf("Subscribed to <b>%s</b>.", $feed_url));
768
+					break;
769
+				case 2:
770
+					print_error(T_sprintf("Could not subscribe to <b>%s</b>.", $feed_url));
771
+					break;
772
+				case 3:
773
+					print_error(T_sprintf("No feeds found in <b>%s</b>.", $feed_url));
774
+					break;
775
+				case 4:
776
+					$feed_urls = $rc["feeds"];
777
+					break;
778
+				case 5:
779
+					print_error(T_sprintf("Could not subscribe to <b>%s</b>.<br>Can't download the Feed URL.", $feed_url));
780
+					break;
781 781
 				}
782 782
 
783 783
 				if ($feed_urls) {
Please login to merge, or discard this patch.
lib/MiniTemplator.class.php 1 patch
Switch Indentation   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -295,23 +295,23 @@  discard block
 block discarded – undo
295 295
    if (!$this->parseWord($cmdL,$p,$cmd)) return true;
296 296
    $parms = substr($cmdL,$p);
297 297
    switch (strtoupper($cmd)) {
298
-      case '$BEGINBLOCK':
299
-         if (!$this->processBeginBlockCmd($parms,$cmdTPosBegin,$cmdTPosEnd))
300
-            return false;
301
-         break;
302
-      case '$ENDBLOCK':
303
-         if (!$this->processEndBlockCmd($parms,$cmdTPosBegin,$cmdTPosEnd))
304
-            return false;
305
-         break;
306
-      case '$INCLUDE':
307
-         if (!$this->processincludeCmd($parms,$cmdTPosBegin,$cmdTPosEnd))
308
-            return false;
309
-         $resumeFromStart = true;
310
-         break;
311
-      default:
312
-         if ($cmd{0} == '$' && !(strlen($cmd) >= 2 && $cmd{1} == '{')) {
313
-            $this->triggerError ("Unknown command \"$cmd\" in template at offset $cmdTPosBegin.");
314
-            return false; }}
298
+   case '$BEGINBLOCK':
299
+      if (!$this->processBeginBlockCmd($parms,$cmdTPosBegin,$cmdTPosEnd))
300
+         return false;
301
+      break;
302
+   case '$ENDBLOCK':
303
+      if (!$this->processEndBlockCmd($parms,$cmdTPosBegin,$cmdTPosEnd))
304
+         return false;
305
+      break;
306
+   case '$INCLUDE':
307
+      if (!$this->processincludeCmd($parms,$cmdTPosBegin,$cmdTPosEnd))
308
+         return false;
309
+      $resumeFromStart = true;
310
+      break;
311
+   default:
312
+      if ($cmd{0} == '$' && !(strlen($cmd) >= 2 && $cmd{1} == '{')) {
313
+         $this->triggerError ("Unknown command \"$cmd\" in template at offset $cmdTPosBegin.");
314
+         return false; }}
315 315
     return true; }
316 316
 
317 317
 /**
@@ -765,25 +765,25 @@  discard block
 block discarded – undo
765 765
       if ($tPos2 > $tPos)
766 766
          $this->writeString (substr($this->template,$tPos,$tPos2-$tPos));
767 767
       switch ($kind) {
768
-         case 0:         // end of block
769
-            return;
770
-         case 1:         // variable
771
-            $vrtr =& $this->varRefTab[$varRefNo];
772
-            if ($vrtr['blockNo'] != $blockNo)
773
-               $this->programLogicError (4);
774
-            $variableValue = $bitr['blockVarTab'][$vrtr['blockVarNo']];
775
-            $this->writeString ($variableValue);
776
-            $tPos = $vrtr['tPosEnd'];
777
-            $varRefNo += 1;
778
-            break;
779
-         case 2:         // sub block
780
-            $subBtr =& $this->blockTab[$subBlockNo];
781
-            if ($subBtr['parentBlockNo'] != $blockNo)
782
-               $this->programLogicError (3);
783
-            $this->writeBlockInstances ($subBlockNo, $bitr['instanceLevel']);  // recursive call
784
-            $tPos = $subBtr['tPosEnd'];
785
-            $subBlockNo += 1;
786
-            break; }}}
768
+      case 0:         // end of block
769
+         return;
770
+      case 1:         // variable
771
+         $vrtr =& $this->varRefTab[$varRefNo];
772
+         if ($vrtr['blockNo'] != $blockNo)
773
+            $this->programLogicError (4);
774
+         $variableValue = $bitr['blockVarTab'][$vrtr['blockVarNo']];
775
+         $this->writeString ($variableValue);
776
+         $tPos = $vrtr['tPosEnd'];
777
+         $varRefNo += 1;
778
+         break;
779
+      case 2:         // sub block
780
+         $subBtr =& $this->blockTab[$subBlockNo];
781
+         if ($subBtr['parentBlockNo'] != $blockNo)
782
+            $this->programLogicError (3);
783
+         $this->writeBlockInstances ($subBlockNo, $bitr['instanceLevel']);  // recursive call
784
+         $tPos = $subBtr['tPosEnd'];
785
+         $subBlockNo += 1;
786
+         break; }}}
787 787
 
788 788
 /**
789 789
 * @access private
@@ -791,17 +791,17 @@  discard block
 block discarded – undo
791 791
 function writeString ($s) {
792 792
    if ($this->outputError) return;
793 793
    switch ($this->outputMode) {
794
-      case 0:            // output to PHP output stream
795
-         if (!print($s))
796
-            $this->outputError = true;
797
-         break;
798
-      case 1:            // output to file
799
-         $rc = fwrite($this->outputFileHandle, $s);
800
-         if ($rc === false) $this->outputError = true;
801
-         break;
802
-      case 2:            // output to string
803
-         $this->outputString .= $s;
804
-         break; }}
794
+   case 0:            // output to PHP output stream
795
+      if (!print($s))
796
+         $this->outputError = true;
797
+      break;
798
+   case 1:            // output to file
799
+      $rc = fwrite($this->outputFileHandle, $s);
800
+      if ($rc === false) $this->outputError = true;
801
+      break;
802
+   case 2:            // output to string
803
+      $this->outputString .= $s;
804
+      break; }}
805 805
 
806 806
 //--- name lookup routines ------------------------------------------------------------------------------------------
807 807
 
Please login to merge, or discard this patch.
lib/phpqrcode/qrsplit.php 1 patch
Switch Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -255,14 +255,14 @@
 block discarded – undo
255 255
                 $mode = $this->identifyMode(0);
256 256
                 
257 257
                 switch ($mode) {
258
-                    case QR_MODE_NUM: $length = $this->eatNum(); break;
259
-                    case QR_MODE_AN:  $length = $this->eatAn(); break;
260
-                    case QR_MODE_KANJI:
261
-                        if ($this->modeHint == QR_MODE_KANJI)
262
-                                $length = $this->eatKanji();
263
-                        else    $length = $this->eat8();
264
-                        break;
265
-                    default: $length = $this->eat8(); break;
258
+                case QR_MODE_NUM: $length = $this->eatNum(); break;
259
+                case QR_MODE_AN:  $length = $this->eatAn(); break;
260
+                case QR_MODE_KANJI:
261
+                    if ($this->modeHint == QR_MODE_KANJI)
262
+                            $length = $this->eatKanji();
263
+                    else    $length = $this->eat8();
264
+                    break;
265
+                default: $length = $this->eat8(); break;
266 266
                 
267 267
                 }
268 268
 
Please login to merge, or discard this patch.