Passed
Push — master ( 164b32...402455 )
by Cody
03:43 queued 19s
created
plugins/search_sphinx/sphinxapi.php 1 patch
Switch Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -1003,22 +1003,22 @@  discard block
 block discarded – undo
1003 1003
             $req .= pack("N", $filter["type"]);
1004 1004
             switch ($filter["type"])
1005 1005
             {
1006
-                case SPH_FILTER_VALUES:
1007
-                    $req .= pack("N", count($filter["values"]));
1008
-                    foreach ($filter["values"] as $value)
1009
-                        $req .= sphPackI64($value);
1010
-                    break;
1011
-
1012
-                case SPH_FILTER_RANGE:
1013
-                    $req .= sphPackI64($filter["min"]).sphPackI64($filter["max"]);
1014
-                    break;
1015
-
1016
-                case SPH_FILTER_FLOATRANGE:
1017
-                    $req .= $this->_PackFloat($filter["min"]).$this->_PackFloat($filter["max"]);
1018
-                    break;
1019
-
1020
-                default:
1021
-                    assert(0 && "internal error: unhandled filter type");
1006
+            case SPH_FILTER_VALUES:
1007
+                $req .= pack("N", count($filter["values"]));
1008
+                foreach ($filter["values"] as $value)
1009
+                    $req .= sphPackI64($value);
1010
+                break;
1011
+
1012
+            case SPH_FILTER_RANGE:
1013
+                $req .= sphPackI64($filter["min"]).sphPackI64($filter["max"]);
1014
+                break;
1015
+
1016
+            case SPH_FILTER_FLOATRANGE:
1017
+                $req .= $this->_PackFloat($filter["min"]).$this->_PackFloat($filter["max"]);
1018
+                break;
1019
+
1020
+            default:
1021
+                assert(0 && "internal error: unhandled filter type");
1022 1022
             }
1023 1023
             $req .= pack("N", $filter["exclude"]);
1024 1024
         }
@@ -1073,9 +1073,9 @@  discard block
 block discarded – undo
1073 1073
                 $req .= sphPackU64($id);
1074 1074
                 switch ($entry["type"])
1075 1075
                 {
1076
-                    case SPH_ATTR_FLOAT:	$req .= $this->_PackFloat($val); break;
1077
-                    case SPH_ATTR_BIGINT:	$req .= sphPackI64($val); break;
1078
-                    default:				$req .= pack("N", $val); break;
1076
+                case SPH_ATTR_FLOAT:	$req .= $this->_PackFloat($val); break;
1077
+                case SPH_ATTR_BIGINT:	$req .= sphPackI64($val); break;
1078
+                default:				$req .= pack("N", $val); break;
1079 1079
                 }
1080 1080
             }
1081 1081
         }
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
@@ -1071,70 +1071,70 @@
 block discarded – undo
1071 1071
                 $qpart = "";
1072 1072
 
1073 1073
                 switch ($k) {
1074
-                    case "title":
1075
-                        $qpart = "title = ".$this->pdo->quote($feed_title);
1076
-                        break;
1077
-
1078
-                    case "feed_url":
1079
-                        $qpart = "feed_url = ".$this->pdo->quote($feed_url);
1080
-                        break;
1081
-
1082
-                    case "update_interval":
1083
-                        $qpart = "update_interval = ".$this->pdo->quote($upd_intl);
1084
-                        break;
1085
-
1086
-                    case "purge_interval":
1087
-                        $qpart = "purge_interval =".$this->pdo->quote($purge_intl);
1088
-                        break;
1089
-
1090
-                    case "auth_login":
1091
-                        $qpart = "auth_login = ".$this->pdo->quote($auth_login);
1092
-                        break;
1093
-
1094
-                    case "auth_pass":
1095
-                        $qpart = "auth_pass =".$this->pdo->quote($auth_pass).", auth_pass_encrypted = false";
1096
-                        break;
1097
-
1098
-                    case "private":
1099
-                        $qpart = "private = ".$this->pdo->quote($private);
1100
-                        break;
1101
-
1102
-                    case "include_in_digest":
1103
-                        $qpart = "include_in_digest = ".$this->pdo->quote($include_in_digest);
1104
-                        break;
1105
-
1106
-                    case "always_display_enclosures":
1107
-                        $qpart = "always_display_enclosures = ".$this->pdo->quote($always_display_enclosures);
1108
-                        break;
1109
-
1110
-                    case "mark_unread_on_update":
1111
-                        $qpart = "mark_unread_on_update = ".$this->pdo->quote($mark_unread_on_update);
1112
-                        break;
1113
-
1114
-                    case "cache_images":
1115
-                        $qpart = "cache_images = ".$this->pdo->quote($cache_images);
1116
-                        break;
1117
-
1118
-                    case "hide_images":
1119
-                        $qpart = "hide_images = ".$this->pdo->quote($hide_images);
1120
-                        break;
1121
-
1122
-                    case "cat_id":
1123
-                        if (get_pref('ENABLE_FEED_CATS')) {
1124
-                            if ($cat_id) {
1125
-                                $qpart = "cat_id = ".$this->pdo->quote($cat_id);
1126
-                            } else {
1127
-                                $qpart = 'cat_id = NULL';
1128
-                            }
1074
+                case "title":
1075
+                    $qpart = "title = ".$this->pdo->quote($feed_title);
1076
+                    break;
1077
+
1078
+                case "feed_url":
1079
+                    $qpart = "feed_url = ".$this->pdo->quote($feed_url);
1080
+                    break;
1081
+
1082
+                case "update_interval":
1083
+                    $qpart = "update_interval = ".$this->pdo->quote($upd_intl);
1084
+                    break;
1085
+
1086
+                case "purge_interval":
1087
+                    $qpart = "purge_interval =".$this->pdo->quote($purge_intl);
1088
+                    break;
1089
+
1090
+                case "auth_login":
1091
+                    $qpart = "auth_login = ".$this->pdo->quote($auth_login);
1092
+                    break;
1093
+
1094
+                case "auth_pass":
1095
+                    $qpart = "auth_pass =".$this->pdo->quote($auth_pass).", auth_pass_encrypted = false";
1096
+                    break;
1097
+
1098
+                case "private":
1099
+                    $qpart = "private = ".$this->pdo->quote($private);
1100
+                    break;
1101
+
1102
+                case "include_in_digest":
1103
+                    $qpart = "include_in_digest = ".$this->pdo->quote($include_in_digest);
1104
+                    break;
1105
+
1106
+                case "always_display_enclosures":
1107
+                    $qpart = "always_display_enclosures = ".$this->pdo->quote($always_display_enclosures);
1108
+                    break;
1109
+
1110
+                case "mark_unread_on_update":
1111
+                    $qpart = "mark_unread_on_update = ".$this->pdo->quote($mark_unread_on_update);
1112
+                    break;
1113
+
1114
+                case "cache_images":
1115
+                    $qpart = "cache_images = ".$this->pdo->quote($cache_images);
1116
+                    break;
1117
+
1118
+                case "hide_images":
1119
+                    $qpart = "hide_images = ".$this->pdo->quote($hide_images);
1120
+                    break;
1121
+
1122
+                case "cat_id":
1123
+                    if (get_pref('ENABLE_FEED_CATS')) {
1124
+                        if ($cat_id) {
1125
+                            $qpart = "cat_id = ".$this->pdo->quote($cat_id);
1129 1126
                         } else {
1130
-                            $qpart = "";
1127
+                            $qpart = 'cat_id = NULL';
1131 1128
                         }
1129
+                    } else {
1130
+                        $qpart = "";
1131
+                    }
1132 1132
 
1133
-                        break;
1133
+                    break;
1134 1134
 
1135
-                    case "feed_language":
1136
-                        $qpart = "feed_language = ".$this->pdo->quote($feed_language);
1137
-                        break;
1135
+                case "feed_language":
1136
+                    $qpart = "feed_language = ".$this->pdo->quote($feed_language);
1137
+                    break;
1138 1138
 
1139 1139
                 }
1140 1140
 
Please login to merge, or discard this patch.
classes/pref/prefs.php 1 patch
Switch Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -172,26 +172,26 @@
 block discarded – undo
172 172
             $value = $_POST[$pref_name];
173 173
 
174 174
             switch ($pref_name) {
175
-                case 'DIGEST_PREFERRED_TIME':
176
-                    if (get_pref('DIGEST_PREFERRED_TIME') != $value) {
175
+            case 'DIGEST_PREFERRED_TIME':
176
+                if (get_pref('DIGEST_PREFERRED_TIME') != $value) {
177 177
 
178
-                        $sth = $this->pdo->prepare("UPDATE ttrss_users SET
178
+                    $sth = $this->pdo->prepare("UPDATE ttrss_users SET
179 179
 						last_digest_sent = NULL WHERE id = ?");
180
-                        $sth->execute([$_SESSION['uid']]);
180
+                    $sth->execute([$_SESSION['uid']]);
181 181
 
182
-                    }
183
-                    break;
184
-                case 'USER_LANGUAGE':
185
-                    if (!$need_reload) {
186
-                        $need_reload = $_SESSION["language"] != $value;
187
-                    }
188
-                    break;
182
+                }
183
+                break;
184
+            case 'USER_LANGUAGE':
185
+                if (!$need_reload) {
186
+                    $need_reload = $_SESSION["language"] != $value;
187
+                }
188
+                break;
189 189
 
190
-                case 'USER_CSS_THEME':
191
-                    if (!$need_reload) {
192
-                        $need_reload = get_pref($pref_name) != $value;
193
-                    }
194
-                    break;
190
+            case 'USER_CSS_THEME':
191
+                if (!$need_reload) {
192
+                    $need_reload = get_pref($pref_name) != $value;
193
+                }
194
+                break;
195 195
             }
196 196
 
197 197
             set_pref($pref_name, $value);
Please login to merge, or discard this patch.
classes/feeds.php 1 patch
Switch Indentation   +141 added lines, -141 removed lines patch added patch discarded remove patch
@@ -412,21 +412,21 @@  discard block
 block discarded – undo
412 412
                     $message = $query_error_override;
413 413
                 } else {
414 414
                     switch ($view_mode) {
415
-                        case "unread":
416
-                            $message = __("No unread articles found to display.");
417
-                            break;
418
-                        case "updated":
419
-                            $message = __("No updated articles found to display.");
420
-                            break;
421
-                        case "marked":
422
-                            $message = __("No starred articles found to display.");
423
-                            break;
424
-                        default:
425
-                            if ($feed < LABEL_BASE_INDEX) {
426
-                                $message = __("No articles found to display. You can assign articles to labels manually from article header context menu (applies to all selected articles) or use a filter.");
427
-                            } else {
428
-                                $message = __("No articles found to display.");
429
-                            }
415
+                    case "unread":
416
+                        $message = __("No unread articles found to display.");
417
+                        break;
418
+                    case "updated":
419
+                        $message = __("No updated articles found to display.");
420
+                        break;
421
+                    case "marked":
422
+                        $message = __("No starred articles found to display.");
423
+                        break;
424
+                    default:
425
+                        if ($feed < LABEL_BASE_INDEX) {
426
+                            $message = __("No articles found to display. You can assign articles to labels manually from article header context menu (applies to all selected articles) or use a filter.");
427
+                        } else {
428
+                            $message = __("No articles found to display.");
429
+                        }
430 430
                     }
431 431
                 }
432 432
 
@@ -893,29 +893,29 @@  discard block
 block discarded – undo
893 893
         // TODO: all this interval stuff needs some generic generator function
894 894
 
895 895
         switch ($mode) {
896
-            case "1day":
897
-                if (DB_TYPE == "pgsql") {
898
-                    $date_qpart = "date_entered < NOW() - INTERVAL '1 day' ";
899
-                } else {
900
-                    $date_qpart = "date_entered < DATE_SUB(NOW(), INTERVAL 1 DAY) ";
901
-                }
902
-                break;
903
-            case "1week":
904
-                if (DB_TYPE == "pgsql") {
905
-                    $date_qpart = "date_entered < NOW() - INTERVAL '1 week' ";
906
-                } else {
907
-                    $date_qpart = "date_entered < DATE_SUB(NOW(), INTERVAL 1 WEEK) ";
908
-                }
909
-                break;
910
-            case "2week":
911
-                if (DB_TYPE == "pgsql") {
912
-                    $date_qpart = "date_entered < NOW() - INTERVAL '2 week' ";
913
-                } else {
914
-                    $date_qpart = "date_entered < DATE_SUB(NOW(), INTERVAL 2 WEEK) ";
915
-                }
916
-                break;
917
-            default:
918
-                $date_qpart = "true";
896
+        case "1day":
897
+            if (DB_TYPE == "pgsql") {
898
+                $date_qpart = "date_entered < NOW() - INTERVAL '1 day' ";
899
+            } else {
900
+                $date_qpart = "date_entered < DATE_SUB(NOW(), INTERVAL 1 DAY) ";
901
+            }
902
+            break;
903
+        case "1week":
904
+            if (DB_TYPE == "pgsql") {
905
+                $date_qpart = "date_entered < NOW() - INTERVAL '1 week' ";
906
+            } else {
907
+                $date_qpart = "date_entered < DATE_SUB(NOW(), INTERVAL 1 WEEK) ";
908
+            }
909
+            break;
910
+        case "2week":
911
+            if (DB_TYPE == "pgsql") {
912
+                $date_qpart = "date_entered < NOW() - INTERVAL '2 week' ";
913
+            } else {
914
+                $date_qpart = "date_entered < DATE_SUB(NOW(), INTERVAL 2 WEEK) ";
915
+            }
916
+            break;
917
+        default:
918
+            $date_qpart = "true";
919 919
         }
920 920
 
921 921
         if (is_numeric($feed)) {
@@ -1237,28 +1237,28 @@  discard block
 block discarded – undo
1237 1237
 
1238 1238
     public static function getFeedIcon($id) {
1239 1239
         switch ($id) {
1240
-            case 0:
1241
-                return "archive";
1242
-            case -1:
1243
-                return "star";
1244
-            case -2:
1245
-                return "rss_feed";
1246
-            case -3:
1247
-                return "whatshot";
1248
-            case -4:
1249
-                return "inbox";
1250
-            case -6:
1251
-                return "restore";
1252
-            default:
1253
-                if ($id < LABEL_BASE_INDEX) {
1254
-                    return "label";
1255
-                } else {
1256
-                    $icon = self::getIconFile($id);
1240
+        case 0:
1241
+            return "archive";
1242
+        case -1:
1243
+            return "star";
1244
+        case -2:
1245
+            return "rss_feed";
1246
+        case -3:
1247
+            return "whatshot";
1248
+        case -4:
1249
+            return "inbox";
1250
+        case -6:
1251
+            return "restore";
1252
+        default:
1253
+            if ($id < LABEL_BASE_INDEX) {
1254
+                return "label";
1255
+            } else {
1256
+                $icon = self::getIconFile($id);
1257 1257
 
1258
-                    if ($icon && file_exists($icon)) {
1259
-                        return ICONS_URL."/".basename($icon)."?".filemtime($icon);
1260
-                    }
1258
+                if ($icon && file_exists($icon)) {
1259
+                    return ICONS_URL."/".basename($icon)."?".filemtime($icon);
1261 1260
                 }
1261
+            }
1262 1262
         }
1263 1263
 
1264 1264
         return false;
@@ -2263,104 +2263,104 @@  discard block
 block discarded – undo
2263 2263
             $commandpair = explode(":", mb_strtolower($k), 2);
2264 2264
 
2265 2265
             switch ($commandpair[0]) {
2266
-                case "title":
2267
-                    if ($commandpair[1]) {
2268
-                        array_push($query_keywords, "($not (LOWER(ttrss_entries.title) LIKE ".
2269
-                            $pdo->quote('%'.mb_strtolower($commandpair[1]).'%')."))");
2270
-                    } else {
2271
-                        array_push($query_keywords, "(UPPER(ttrss_entries.title) $not LIKE UPPER('%$k%')
2266
+            case "title":
2267
+                if ($commandpair[1]) {
2268
+                    array_push($query_keywords, "($not (LOWER(ttrss_entries.title) LIKE ".
2269
+                        $pdo->quote('%'.mb_strtolower($commandpair[1]).'%')."))");
2270
+                } else {
2271
+                    array_push($query_keywords, "(UPPER(ttrss_entries.title) $not LIKE UPPER('%$k%')
2272 2272
 								OR UPPER(ttrss_entries.content) $not LIKE UPPER(".$pdo->quote("%$k%")."))");
2273
-                        array_push($search_words, $k);
2274
-                    }
2275
-                    break;
2276
-                case "author":
2277
-                    if ($commandpair[1]) {
2278
-                        array_push($query_keywords, "($not (LOWER(author) LIKE ".
2279
-                            $pdo->quote('%'.mb_strtolower($commandpair[1]).'%')."))");
2280
-                    } else {
2281
-                        array_push($query_keywords, "(UPPER(ttrss_entries.title) $not LIKE UPPER('%$k%')
2273
+                    array_push($search_words, $k);
2274
+                }
2275
+                break;
2276
+            case "author":
2277
+                if ($commandpair[1]) {
2278
+                    array_push($query_keywords, "($not (LOWER(author) LIKE ".
2279
+                        $pdo->quote('%'.mb_strtolower($commandpair[1]).'%')."))");
2280
+                } else {
2281
+                    array_push($query_keywords, "(UPPER(ttrss_entries.title) $not LIKE UPPER('%$k%')
2282 2282
 								OR UPPER(ttrss_entries.content) $not LIKE UPPER(".$pdo->quote("%$k%")."))");
2283
-                        array_push($search_words, $k);
2284
-                    }
2285
-                    break;
2286
-                case "note":
2287
-                    if ($commandpair[1]) {
2288
-                        if ($commandpair[1] == "true")
2289
-                            array_push($query_keywords, "($not (note IS NOT NULL AND note != ''))");
2290
-                        else if ($commandpair[1] == "false")
2291
-                            array_push($query_keywords, "($not (note IS NULL OR note = ''))");
2292
-                        else
2293
-                            array_push($query_keywords, "($not (LOWER(note) LIKE ".
2294
-                                $pdo->quote('%'.mb_strtolower($commandpair[1]).'%')."))");
2295
-                    } else {
2296
-                        array_push($query_keywords, "(UPPER(ttrss_entries.title) $not LIKE UPPER(".$pdo->quote("%$k%").")
2283
+                    array_push($search_words, $k);
2284
+                }
2285
+                break;
2286
+            case "note":
2287
+                if ($commandpair[1]) {
2288
+                    if ($commandpair[1] == "true")
2289
+                        array_push($query_keywords, "($not (note IS NOT NULL AND note != ''))");
2290
+                    else if ($commandpair[1] == "false")
2291
+                        array_push($query_keywords, "($not (note IS NULL OR note = ''))");
2292
+                    else
2293
+                        array_push($query_keywords, "($not (LOWER(note) LIKE ".
2294
+                            $pdo->quote('%'.mb_strtolower($commandpair[1]).'%')."))");
2295
+                } else {
2296
+                    array_push($query_keywords, "(UPPER(ttrss_entries.title) $not LIKE UPPER(".$pdo->quote("%$k%").")
2297 2297
 								OR UPPER(ttrss_entries.content) $not LIKE UPPER(".$pdo->quote("%$k%")."))");
2298
-                        if (!$not) array_push($search_words, $k);
2299
-                    }
2300
-                    break;
2301
-                case "star":
2302
-
2303
-                    if ($commandpair[1]) {
2304
-                        if ($commandpair[1] == "true")
2305
-                            array_push($query_keywords, "($not (marked = true))");
2306
-                        else
2307
-                            array_push($query_keywords, "($not (marked = false))");
2308
-                    } else {
2309
-                        array_push($query_keywords, "(UPPER(ttrss_entries.title) $not LIKE UPPER(".$pdo->quote("%$k%").")
2298
+                    if (!$not) array_push($search_words, $k);
2299
+                }
2300
+                break;
2301
+            case "star":
2302
+
2303
+                if ($commandpair[1]) {
2304
+                    if ($commandpair[1] == "true")
2305
+                        array_push($query_keywords, "($not (marked = true))");
2306
+                    else
2307
+                        array_push($query_keywords, "($not (marked = false))");
2308
+                } else {
2309
+                    array_push($query_keywords, "(UPPER(ttrss_entries.title) $not LIKE UPPER(".$pdo->quote("%$k%").")
2310 2310
 								OR UPPER(ttrss_entries.content) $not LIKE UPPER(".$pdo->quote("%$k%")."))");
2311
-                        if (!$not) array_push($search_words, $k);
2312
-                    }
2313
-                    break;
2314
-                case "pub":
2315
-                    if ($commandpair[1]) {
2316
-                        if ($commandpair[1] == "true")
2317
-                            array_push($query_keywords, "($not (published = true))");
2318
-                        else
2319
-                            array_push($query_keywords, "($not (published = false))");
2311
+                    if (!$not) array_push($search_words, $k);
2312
+                }
2313
+                break;
2314
+            case "pub":
2315
+                if ($commandpair[1]) {
2316
+                    if ($commandpair[1] == "true")
2317
+                        array_push($query_keywords, "($not (published = true))");
2318
+                    else
2319
+                        array_push($query_keywords, "($not (published = false))");
2320 2320
 
2321
-                    } else {
2322
-                        array_push($query_keywords, "(UPPER(ttrss_entries.title) $not LIKE UPPER('%$k%')
2321
+                } else {
2322
+                    array_push($query_keywords, "(UPPER(ttrss_entries.title) $not LIKE UPPER('%$k%')
2323 2323
 								OR UPPER(ttrss_entries.content) $not LIKE UPPER(".$pdo->quote("%$k%")."))");
2324
-                        if (!$not) array_push($search_words, $k);
2325
-                    }
2326
-                    break;
2327
-                case "unread":
2328
-                    if ($commandpair[1]) {
2329
-                        if ($commandpair[1] == "true")
2330
-                            array_push($query_keywords, "($not (unread = true))");
2331
-                        else
2332
-                            array_push($query_keywords, "($not (unread = false))");
2324
+                    if (!$not) array_push($search_words, $k);
2325
+                }
2326
+                break;
2327
+            case "unread":
2328
+                if ($commandpair[1]) {
2329
+                    if ($commandpair[1] == "true")
2330
+                        array_push($query_keywords, "($not (unread = true))");
2331
+                    else
2332
+                        array_push($query_keywords, "($not (unread = false))");
2333 2333
 
2334
-                    } else {
2335
-                        array_push($query_keywords, "(UPPER(ttrss_entries.title) $not LIKE UPPER(".$pdo->quote("%$k%").")
2334
+                } else {
2335
+                    array_push($query_keywords, "(UPPER(ttrss_entries.title) $not LIKE UPPER(".$pdo->quote("%$k%").")
2336 2336
 								OR UPPER(ttrss_entries.content) $not LIKE UPPER(".$pdo->quote("%$k%")."))");
2337
-                        if (!$not) array_push($search_words, $k);
2338
-                    }
2339
-                    break;
2340
-                default:
2341
-                    if (strpos($k, "@") === 0) {
2337
+                    if (!$not) array_push($search_words, $k);
2338
+                }
2339
+                break;
2340
+            default:
2341
+                if (strpos($k, "@") === 0) {
2342 2342
 
2343
-                        $user_tz_string = get_pref('USER_TIMEZONE', $_SESSION['uid']);
2344
-                        $orig_ts = strtotime(substr($k, 1));
2345
-                        $k = date("Y-m-d", convert_timestamp($orig_ts, $user_tz_string, 'UTC'));
2343
+                    $user_tz_string = get_pref('USER_TIMEZONE', $_SESSION['uid']);
2344
+                    $orig_ts = strtotime(substr($k, 1));
2345
+                    $k = date("Y-m-d", convert_timestamp($orig_ts, $user_tz_string, 'UTC'));
2346 2346
 
2347
-                        //$k = date("Y-m-d", strtotime(substr($k, 1)));
2347
+                    //$k = date("Y-m-d", strtotime(substr($k, 1)));
2348 2348
 
2349
-                        array_push($query_keywords, "(".SUBSTRING_FOR_DATE."(updated,1,LENGTH('$k')) $not = '$k')");
2350
-                    } else {
2349
+                    array_push($query_keywords, "(".SUBSTRING_FOR_DATE."(updated,1,LENGTH('$k')) $not = '$k')");
2350
+                } else {
2351 2351
 
2352
-                        if (DB_TYPE == "pgsql") {
2353
-                            $k = mb_strtolower($k);
2354
-                            array_push($search_query_leftover, $not ? "!$k" : $k);
2355
-                        } else {
2356
-                            array_push($query_keywords, "(UPPER(ttrss_entries.title) $not LIKE UPPER(".$pdo->quote("%$k%").")
2352
+                    if (DB_TYPE == "pgsql") {
2353
+                        $k = mb_strtolower($k);
2354
+                        array_push($search_query_leftover, $not ? "!$k" : $k);
2355
+                    } else {
2356
+                        array_push($query_keywords, "(UPPER(ttrss_entries.title) $not LIKE UPPER(".$pdo->quote("%$k%").")
2357 2357
 								OR UPPER(ttrss_entries.content) $not LIKE UPPER(".$pdo->quote("%$k%")."))");
2358
-                        }
2358
+                    }
2359 2359
 
2360
-                        if (!$not) {
2361
-                            array_push($search_words, $k);
2362
-                        }
2360
+                    if (!$not) {
2361
+                        array_push($search_words, $k);
2363 2362
                     }
2363
+                }
2364 2364
             }
2365 2365
         }
2366 2366
 
Please login to merge, or discard this patch.
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/rssutils.php 1 patch
Switch Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -1364,35 +1364,35 @@
 block discarded – undo
1364 1364
                 }
1365 1365
 
1366 1366
                 switch ($rule["type"]) {
1367
-                    case "title":
1368
-                        $match = @preg_match("/$reg_exp/iu", $title);
1369
-                        break;
1370
-                    case "content":
1371
-                        // we don't need to deal with multiline regexps
1372
-                        $content = preg_replace("/[\r\n\t]/", "", $content);
1367
+                case "title":
1368
+                    $match = @preg_match("/$reg_exp/iu", $title);
1369
+                    break;
1370
+                case "content":
1371
+                    // we don't need to deal with multiline regexps
1372
+                    $content = preg_replace("/[\r\n\t]/", "", $content);
1373 1373
 
1374
-                        $match = @preg_match("/$reg_exp/iu", $content);
1375
-                        break;
1376
-                    case "both":
1377
-                        // we don't need to deal with multiline regexps
1378
-                        $content = preg_replace("/[\r\n\t]/", "", $content);
1374
+                    $match = @preg_match("/$reg_exp/iu", $content);
1375
+                    break;
1376
+                case "both":
1377
+                    // we don't need to deal with multiline regexps
1378
+                    $content = preg_replace("/[\r\n\t]/", "", $content);
1379 1379
 
1380
-                        $match = (@preg_match("/$reg_exp/iu", $title) || @preg_match("/$reg_exp/iu", $content));
1381
-                        break;
1382
-                    case "link":
1383
-                        $match = @preg_match("/$reg_exp/iu", $link);
1384
-                        break;
1385
-                    case "author":
1386
-                        $match = @preg_match("/$reg_exp/iu", $author);
1387
-                        break;
1388
-                    case "tag":
1389
-                        foreach ($tags as $tag) {
1390
-                            if (@preg_match("/$reg_exp/iu", $tag)) {
1391
-                                $match = true;
1392
-                                break;
1393
-                            }
1380
+                    $match = (@preg_match("/$reg_exp/iu", $title) || @preg_match("/$reg_exp/iu", $content));
1381
+                    break;
1382
+                case "link":
1383
+                    $match = @preg_match("/$reg_exp/iu", $link);
1384
+                    break;
1385
+                case "author":
1386
+                    $match = @preg_match("/$reg_exp/iu", $author);
1387
+                    break;
1388
+                case "tag":
1389
+                    foreach ($tags as $tag) {
1390
+                        if (@preg_match("/$reg_exp/iu", $tag)) {
1391
+                            $match = true;
1392
+                            break;
1394 1393
                         }
1395
-                        break;
1394
+                    }
1395
+                    break;
1396 1396
                 }
1397 1397
 
1398 1398
                 if ($rule_inverse) {
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
@@ -222,16 +222,16 @@  discard block
 block discarded – undo
222 222
 
223 223
             $override_order = false;
224 224
             switch (clean($_REQUEST["order_by"])) {
225
-                case "title":
226
-                    $override_order = "ttrss_entries.title, date_entered, updated";
227
-                    break;
228
-                case "date_reverse":
229
-                    $override_order = "score DESC, date_entered, updated";
230
-                    $skip_first_id_check = true;
231
-                    break;
232
-                case "feed_dates":
233
-                    $override_order = "updated DESC";
234
-                    break;
225
+            case "title":
226
+                $override_order = "ttrss_entries.title, date_entered, updated";
227
+                break;
228
+            case "date_reverse":
229
+                $override_order = "score DESC, date_entered, updated";
230
+                $skip_first_id_check = true;
231
+                break;
232
+            case "feed_dates":
233
+                $override_order = "updated DESC";
234
+                break;
235 235
             }
236 236
 
237 237
             /* do not rely on params below */
@@ -263,32 +263,32 @@  discard block
 block discarded – undo
263 263
         $set_to = "";
264 264
 
265 265
         switch ($field_raw) {
266
-            case 0:
267
-                $field = "marked";
268
-                $additional_fields = ",last_marked = NOW()";
269
-                break;
270
-            case 1:
271
-                $field = "published";
272
-                $additional_fields = ",last_published = NOW()";
273
-                break;
274
-            case 2:
275
-                $field = "unread";
276
-                $additional_fields = ",last_read = NOW()";
277
-                break;
278
-            case 3:
279
-                $field = "note";
266
+        case 0:
267
+            $field = "marked";
268
+            $additional_fields = ",last_marked = NOW()";
269
+            break;
270
+        case 1:
271
+            $field = "published";
272
+            $additional_fields = ",last_published = NOW()";
273
+            break;
274
+        case 2:
275
+            $field = "unread";
276
+            $additional_fields = ",last_read = NOW()";
277
+            break;
278
+        case 3:
279
+            $field = "note";
280 280
         };
281 281
 
282 282
         switch ($mode) {
283
-            case 1:
284
-                $set_to = "true";
285
-                break;
286
-            case 0:
287
-                $set_to = "false";
288
-                break;
289
-            case 2:
290
-                $set_to = "not $field";
291
-                break;
283
+        case 1:
284
+            $set_to = "true";
285
+            break;
286
+        case 0:
287
+            $set_to = "false";
288
+            break;
289
+        case 2:
290
+            $set_to = "not $field";
291
+            break;
292 292
         }
293 293
 
294 294
         if ($field == "note") {
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
@@ -64,14 +64,14 @@
 block discarded – undo
64 64
                                         $tmp = '';
65 65
                                         foreach (str_split($keys[$i]) as $c) {
66 66
                                             switch ($c) {
67
-                                                case '*':
68
-                                                    $tmp .= __('Shift').'+';
69
-                                                    break;
70
-                                                case '^':
71
-                                                    $tmp .= __('Ctrl').'+';
72
-                                                    break;
73
-                                                default:
74
-                                                    $tmp .= $c;
67
+                                            case '*':
68
+                                                $tmp .= __('Shift').'+';
69
+                                                break;
70
+                                            case '^':
71
+                                                $tmp .= __('Ctrl').'+';
72
+                                                break;
73
+                                            default:
74
+                                                $tmp .= $c;
75 75
                                             }
76 76
                                         }
77 77
                                         $keys[$i] = $tmp;
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
@@ -305,23 +305,23 @@  discard block
 block discarded – undo
305 305
     if (!$this->parseWord($cmdL, $p, $cmd)) return true;
306 306
     $parms = substr($cmdL, $p);
307 307
     switch (strtoupper($cmd)) {
308
-        case '$BEGINBLOCK':
309
-         if (!$this->processBeginBlockCmd($parms, $cmdTPosBegin, $cmdTPosEnd))
310
-            return false;
311
-            break;
312
-        case '$ENDBLOCK':
313
-         if (!$this->processEndBlockCmd($parms, $cmdTPosBegin, $cmdTPosEnd))
314
-            return false;
315
-            break;
316
-        case '$INCLUDE':
317
-         if (!$this->processincludeCmd($parms, $cmdTPosBegin, $cmdTPosEnd))
318
-            return false;
319
-            $resumeFromStart = true;
320
-            break;
321
-        default:
322
-         if ($cmd{0} == '$' && !(strlen($cmd) >= 2 && $cmd{1} == '{')) {
323
-            $this->triggerError("Unknown command \"$cmd\" in template at offset $cmdTPosBegin.");
324
-            return false; }}
308
+    case '$BEGINBLOCK':
309
+     if (!$this->processBeginBlockCmd($parms, $cmdTPosBegin, $cmdTPosEnd))
310
+        return false;
311
+        break;
312
+    case '$ENDBLOCK':
313
+     if (!$this->processEndBlockCmd($parms, $cmdTPosBegin, $cmdTPosEnd))
314
+        return false;
315
+        break;
316
+    case '$INCLUDE':
317
+     if (!$this->processincludeCmd($parms, $cmdTPosBegin, $cmdTPosEnd))
318
+        return false;
319
+        $resumeFromStart = true;
320
+        break;
321
+    default:
322
+     if ($cmd{0} == '$' && !(strlen($cmd) >= 2 && $cmd{1} == '{')) {
323
+        $this->triggerError("Unknown command \"$cmd\" in template at offset $cmdTPosBegin.");
324
+        return false; }}
325 325
     return true; }
326 326
 
327 327
 /**
@@ -781,25 +781,25 @@  discard block
 block discarded – undo
781 781
         if ($tPos2 > $tPos)
782 782
             $this->writeString(substr($this->template, $tPos, $tPos2 - $tPos));
783 783
         switch ($kind) {
784
-            case 0:         // end of block
785
-            return;
786
-            case 1:         // variable
787
-            $vrtr = & $this->varRefTab[$varRefNo];
788
-            if ($vrtr['blockNo'] != $blockNo)
789
-                $this->programLogicError(4);
790
-            $variableValue = $bitr['blockVarTab'][$vrtr['blockVarNo']];
791
-            $this->writeString($variableValue);
792
-            $tPos = $vrtr['tPosEnd'];
793
-            $varRefNo += 1;
794
-            break;
795
-            case 2:         // sub block
796
-            $subBtr = & $this->blockTab[$subBlockNo];
797
-            if ($subBtr['parentBlockNo'] != $blockNo)
798
-                $this->programLogicError(3);
799
-            $this->writeBlockInstances($subBlockNo, $bitr['instanceLevel']); // recursive call
800
-            $tPos = $subBtr['tPosEnd'];
801
-            $subBlockNo += 1;
802
-            break; }}}
784
+        case 0:         // end of block
785
+        return;
786
+        case 1:         // variable
787
+        $vrtr = & $this->varRefTab[$varRefNo];
788
+        if ($vrtr['blockNo'] != $blockNo)
789
+            $this->programLogicError(4);
790
+        $variableValue = $bitr['blockVarTab'][$vrtr['blockVarNo']];
791
+        $this->writeString($variableValue);
792
+        $tPos = $vrtr['tPosEnd'];
793
+        $varRefNo += 1;
794
+        break;
795
+        case 2:         // sub block
796
+        $subBtr = & $this->blockTab[$subBlockNo];
797
+        if ($subBtr['parentBlockNo'] != $blockNo)
798
+            $this->programLogicError(3);
799
+        $this->writeBlockInstances($subBlockNo, $bitr['instanceLevel']); // recursive call
800
+        $tPos = $subBtr['tPosEnd'];
801
+        $subBlockNo += 1;
802
+        break; }}}
803 803
 
804 804
 /**
805 805
 * @access private
@@ -807,17 +807,17 @@  discard block
 block discarded – undo
807 807
 function writeString($s) {
808 808
     if ($this->outputError) return;
809 809
     switch ($this->outputMode) {
810
-        case 0:            // output to PHP output stream
811
-         if (!print($s))
812
-            $this->outputError = true;
813
-            break;
814
-        case 1:            // output to file
815
-         $rc = fwrite($this->outputFileHandle, $s);
816
-            if ($rc === false) $this->outputError = true;
817
-            break;
818
-        case 2:            // output to string
819
-         $this->outputString .= $s;
820
-            break; }}
810
+    case 0:            // output to PHP output stream
811
+     if (!print($s))
812
+        $this->outputError = true;
813
+        break;
814
+    case 1:            // output to file
815
+     $rc = fwrite($this->outputFileHandle, $s);
816
+        if ($rc === false) $this->outputError = true;
817
+        break;
818
+    case 2:            // output to string
819
+     $this->outputString .= $s;
820
+        break; }}
821 821
 
822 822
 //--- name lookup routines ------------------------------------------------------------------------------------------
823 823
 
Please login to merge, or discard this patch.