Passed
Pull Request — master (#1)
by
unknown
04:51
created
classes/feedparser.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 		if ($error) {
27 27
 			foreach (libxml_get_errors() as $error) {
28 28
 				if ($error->level == LIBXML_ERR_FATAL) {
29
-					if(!isset($this->error)) //currently only the first error is reported
29
+					if (!isset($this->error)) //currently only the first error is reported
30 30
 						$this->error = $this->format_error($error);
31 31
 					$this->libxml_errors [] = $this->format_error($error);
32 32
 				}
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 					$this->type = $this::FEED_ATOM;
70 70
 					break;
71 71
 				default:
72
-					if( !isset($this->error) ){
72
+					if (!isset($this->error)) {
73 73
 						$this->error = "Unknown/unsupported feed type";
74 74
 					}
75 75
 					return;
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 			if ($this->link) $this->link = trim($this->link);
167 167
 
168 168
 		} else {
169
-			if( !isset($this->error) ){
169
+			if (!isset($this->error)) {
170 170
 				$this->error = "Unknown/unsupported feed type";
171 171
 			}
172 172
 			return;
Please login to merge, or discard this patch.
classes/opml.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 			$cat_title = htmlspecialchars($row['title']);
71 71
 
72 72
 			if ($include_settings) {
73
-				$order_id = (int)$row["order_id"];
73
+				$order_id = (int) $row["order_id"];
74 74
 				$ttrss_specific_qpart = "ttrssSortOrder=\"$order_id\"";
75 75
 			}
76 76
 		} else {
@@ -103,8 +103,8 @@  discard block
 block discarded – undo
103 103
 			$site_url = htmlspecialchars($fline["site_url"]);
104 104
 
105 105
 			if ($include_settings) {
106
-				$update_interval = (int)$fline["update_interval"];
107
-				$order_id = (int)$fline["order_id"];
106
+				$update_interval = (int) $fline["update_interval"];
107
+				$order_id = (int) $fline["order_id"];
108 108
 
109 109
 				$ttrss_specific_qpart = "ttrssSortOrder=\"$order_id\" ttrssUpdateInterval=\"$update_interval\"";
110 110
 			} else {
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 
131 131
 		if (!isset($_REQUEST["debug"])) {
132 132
 			header("Content-type: application/xml+opml");
133
-			header("Content-Disposition: attachment; filename=" . $name );
133
+			header("Content-Disposition: attachment; filename=".$name);
134 134
 		} else {
135 135
 			header("Content-type: text/xml");
136 136
 		}
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 
140 140
 		$out .= "<opml version=\"1.0\">";
141 141
 		$out .= "<head>
142
-			<dateCreated>" . date("r", time()) . "</dateCreated>
142
+			<dateCreated>" . date("r", time())."</dateCreated>
143 143
 			<title>Tiny Tiny RSS Feed Export</title>
144 144
 		</head>";
145 145
 		$out .= "<body>";
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 					    foreach (json_decode($tmp_line["match_on"], true) as $feed_id) {
215 215
 
216 216
                             if (strpos($feed_id, "CAT:") === 0) {
217
-                                $feed_id = (int)substr($feed_id, 4);
217
+                                $feed_id = (int) substr($feed_id, 4);
218 218
                                 if ($feed_id) {
219 219
                                     array_push($match, [Feeds::getCategoryTitle($feed_id), true, false]);
220 220
                                 } else {
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
                                 }
223 223
                             } else {
224 224
                                 if ($feed_id) {
225
-                                    array_push($match, [Feeds::getFeedTitle((int)$feed_id), false, false]);
225
+                                    array_push($match, [Feeds::getFeedTitle((int) $feed_id), false, false]);
226 226
                                 } else {
227 227
                                     array_push($match, [0, false, true]);
228 228
                                 }
@@ -409,7 +409,7 @@  discard block
 block discarded – undo
409 409
 						        list ($name, $is_cat, $is_id) = $match;
410 410
 
411 411
 						        if ($is_id) {
412
-						            array_push($match_on, ($is_cat ? "CAT:" : "") . $name);
412
+						            array_push($match_on, ($is_cat ? "CAT:" : "").$name);
413 413
                                 } else {
414 414
 
415 415
                                     if (!$is_cat) {
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
                             }
439 439
 
440 440
                             $reg_exp = $rule["reg_exp"];
441
-                            $filter_type = (int)$rule["filter_type"];
441
+                            $filter_type = (int) $rule["filter_type"];
442 442
                             $inverse = bool_to_sql_bool($rule["inverse"]);
443 443
                             $match_on = json_encode($match_on);
444 444
 
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
 
473 473
                             $cat_filter = bool_to_sql_bool($rule["cat_filter"]);
474 474
                             $reg_exp = $rule["reg_exp"];
475
-                            $filter_type = (int)$rule["filter_type"];
475
+                            $filter_type = (int) $rule["filter_type"];
476 476
                             $inverse = bool_to_sql_bool($rule["inverse"]);
477 477
 
478 478
                             $usth = $this->pdo->prepare("INSERT INTO ttrss_filters2_rules
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
 
486 486
 					foreach ($filter["actions"] as $action) {
487 487
 
488
-						$action_id = (int)$action["action_id"];
488
+						$action_id = (int) $action["action_id"];
489 489
 						$action_param = $action["action_param"];
490 490
 
491 491
 						$usth = $this->pdo->prepare("INSERT INTO ttrss_filters2_actions
@@ -585,7 +585,7 @@  discard block
 block discarded – undo
585 585
 		}
586 586
 
587 587
 		if (is_uploaded_file($_FILES['opml_file']['tmp_name'])) {
588
-			$tmp_file = tempnam(CACHE_DIR . '/upload', 'opml');
588
+			$tmp_file = tempnam(CACHE_DIR.'/upload', 'opml');
589 589
 
590 590
 			$result = move_uploaded_file($_FILES['opml_file']['tmp_name'],
591 591
 				$tmp_file);
@@ -623,10 +623,10 @@  discard block
 block discarded – undo
623 623
 		print "$msg<br/>";
624 624
 	}
625 625
 
626
-	static function opml_publish_url(){
626
+	static function opml_publish_url() {
627 627
 
628 628
 		$url_path = get_self_url_prefix();
629
-		$url_path .= "/opml.php?op=publish&key=" .
629
+		$url_path .= "/opml.php?op=publish&key=".
630 630
 			Feeds::get_feed_access_key('OPML:Publish', false, $_SESSION["uid"]);
631 631
 
632 632
 		return $url_path;
Please login to merge, or discard this patch.
classes/article.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 	static function create_published_article($title, $url, $content, $labels_str,
94 94
 			$owner_uid) {
95 95
 
96
-		$guid = 'SHA1:' . sha1("ttshared:" . $url . $owner_uid); // include owner_uid to prevent global GUID clash
96
+		$guid = 'SHA1:'.sha1("ttshared:".$url.$owner_uid); // include owner_uid to prevent global GUID clash
97 97
 
98 98
 		if (!$content) {
99 99
 			$pluginhost = new PluginHost();
@@ -148,12 +148,12 @@  discard block
 block discarded – undo
148 148
 					content = ?, content_hash = ? WHERE id = ?");
149 149
 				$sth->execute([$content, $content_hash, $ref_id]);
150 150
 
151
-				if (DB_TYPE == "pgsql"){
151
+				if (DB_TYPE == "pgsql") {
152 152
 					$sth = $pdo->prepare("UPDATE ttrss_entries
153 153
 					SET tsvector_combined = to_tsvector( :ts_content)
154 154
 					WHERE id = :id");
155 155
 					$params = [
156
-						":ts_content" => mb_substr(strip_tags($content ), 0, 900000),
156
+						":ts_content" => mb_substr(strip_tags($content), 0, 900000),
157 157
 						":id" => $ref_id];
158 158
 					$sth->execute($params);
159 159
 				}
@@ -193,12 +193,12 @@  discard block
 block discarded – undo
193 193
 
194 194
 			if ($row = $sth->fetch()) {
195 195
 				$ref_id = $row["id"];
196
-				if (DB_TYPE == "pgsql"){
196
+				if (DB_TYPE == "pgsql") {
197 197
 					$sth = $pdo->prepare("UPDATE ttrss_entries
198 198
 					SET tsvector_combined = to_tsvector( :ts_content)
199 199
 					WHERE id = :id");
200 200
 					$params = [
201
-						":ts_content" => mb_substr(strip_tags($content ), 0, 900000),
201
+						":ts_content" => mb_substr(strip_tags($content), 0, 900000),
202 202
 						":id" => $ref_id];
203 203
 					$sth->execute($params);
204 204
 				}
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
 		print_hidden("op", "article");
237 237
 		print_hidden("method", "setArticleTags");
238 238
 
239
-		print "<header class='horizontal'>" . __("Tags for this article (separated by commas):")."</header>";
239
+		print "<header class='horizontal'>".__("Tags for this article (separated by commas):")."</header>";
240 240
 
241 241
 		print "<section>";
242 242
 		print "<textarea dojoType='dijit.form.SimpleTextarea' rows='4'
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 
258 258
 	function setScore() {
259 259
 		$ids = explode(",", clean($_REQUEST['id']));
260
-		$score = (int)clean($_REQUEST['score']);
260
+		$score = (int) clean($_REQUEST['score']);
261 261
 
262 262
 		$ids_qmarks = arr_qmarks($ids);
263 263
 
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
 
267 267
 		$sth->execute(array_merge([$score], $ids, [$_SESSION['uid']]));
268 268
 
269
-		print json_encode(["id" => $ids, "score" => (int)$score]);
269
+		print json_encode(["id" => $ids, "score" => (int) $score]);
270 270
 	}
271 271
 
272 272
 	function getScore() {
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
 
279 279
 		$score = $row['score'];
280 280
 
281
-		print json_encode(["id" => $id, "score" => (int)$score]);
281
+		print json_encode(["id" => $id, "score" => (int) $score]);
282 282
 	}
283 283
 
284 284
 
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
 
337 337
 		if (!$tags_str_full) $tags_str_full = __("no tags");
338 338
 
339
-		print json_encode(array("id" => (int)$id,
339
+		print json_encode(array("id" => (int) $id,
340 340
 				"content" => $tags_str, "content_full" => $tags_str_full));
341 341
 	}
342 342
 
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 
354 354
 		print "<ul>";
355 355
 		while ($line = $sth->fetch()) {
356
-			print "<li>" . $line["tag_name"] . "</li>";
356
+			print "<li>".$line["tag_name"]."</li>";
357 357
 		}
358 358
 		print "</ul>";
359 359
 	}
@@ -492,21 +492,21 @@  discard block
 block discarded – undo
492 492
 								if (!$hide_images) {
493 493
 									$encsize = '';
494 494
 									if ($entry['height'] > 0)
495
-										$encsize .= ' height="' . intval($entry['height']) . '"';
495
+										$encsize .= ' height="'.intval($entry['height']).'"';
496 496
 									if ($entry['width'] > 0)
497
-										$encsize .= ' width="' . intval($entry['width']) . '"';
497
+										$encsize .= ' width="'.intval($entry['width']).'"';
498 498
 									$rv .= "<p><img
499 499
 										alt=\"".htmlspecialchars($entry["filename"])."\"
500
-										src=\"" .htmlspecialchars($entry["url"]) . "\"
501
-										" . $encsize . " /></p>";
500
+										src=\"" .htmlspecialchars($entry["url"])."\"
501
+										" . $encsize." /></p>";
502 502
 								} else {
503 503
 									$rv .= "<p><a target=\"_blank\" rel=\"noopener noreferrer\"
504 504
 										href=\"".htmlspecialchars($entry["url"])."\"
505
-										>" .htmlspecialchars($entry["url"]) . "</a></p>";
505
+										>" .htmlspecialchars($entry["url"])."</a></p>";
506 506
 								}
507 507
 
508 508
 								if ($entry['title']) {
509
-									$rv.= "<div class=\"enclosure_title\">${entry['title']}</div>";
509
+									$rv .= "<div class=\"enclosure_title\">${entry['title']}</div>";
510 510
 								}
511 511
 							}
512 512
 						}
@@ -521,13 +521,13 @@  discard block
 block discarded – undo
521 521
 			}
522 522
 
523 523
 			$rv .= "<div class=\"attachments\" dojoType=\"fox.form.DropDownButton\">".
524
-				"<span>" . __('Attachments')."</span>";
524
+				"<span>".__('Attachments')."</span>";
525 525
 
526 526
 			$rv .= "<div dojoType=\"dijit.Menu\" style=\"display: none;\">";
527 527
 
528 528
 			foreach ($entries as $entry) {
529 529
 				if ($entry["title"])
530
-					$title = " &mdash; " . truncate_string($entry["title"], 30);
530
+					$title = " &mdash; ".truncate_string($entry["title"], 30);
531 531
 				else
532 532
 					$title = "";
533 533
 
@@ -537,7 +537,7 @@  discard block
 block discarded – undo
537 537
 					$filename = "";
538 538
 
539 539
 				$rv .= "<div onclick='popupOpenUrl(\"".htmlspecialchars($entry["url"])."\")'
540
-					dojoType=\"dijit.MenuItem\">".$filename . $title."</div>";
540
+					dojoType=\"dijit.MenuItem\">".$filename.$title."</div>";
541 541
 
542 542
 			};
543 543
 
@@ -606,10 +606,10 @@  discard block
 block discarded – undo
606 606
 			$tags_str = "";
607 607
 
608 608
 			for ($i = 0; $i < $maxtags; $i++) {
609
-				$tags_str .= "<a class=\"tag\" href=\"#\" onclick=\"Feeds.open({feed:'".$tags[$i]."'})\">" . $tags[$i] . "</a>, ";
609
+				$tags_str .= "<a class=\"tag\" href=\"#\" onclick=\"Feeds.open({feed:'".$tags[$i]."'})\">".$tags[$i]."</a>, ";
610 610
 			}
611 611
 
612
-			$tags_str = mb_substr($tags_str, 0, mb_strlen($tags_str)-2);
612
+			$tags_str = mb_substr($tags_str, 0, mb_strlen($tags_str) - 2);
613 613
 
614 614
 			if (count($tags) > $maxtags)
615 615
 				$tags_str .= ", &hellip;";
@@ -803,7 +803,7 @@  discard block
 block discarded – undo
803 803
 		if (!$article_image && !$article_stream) {
804 804
 			$tmpdoc = new DOMDocument();
805 805
 
806
-			if (@$tmpdoc->loadHTML('<?xml encoding="UTF-8">' . mb_substr($content, 0, 131070))) {
806
+			if (@$tmpdoc->loadHTML('<?xml encoding="UTF-8">'.mb_substr($content, 0, 131070))) {
807 807
 				$tmpxpath = new DOMXPath($tmpdoc);
808 808
 				$elems = $tmpxpath->query('(//img[@src]|//video[@poster]|//iframe[contains(@src , "youtube.com/embed/")])');
809 809
 
@@ -811,8 +811,8 @@  discard block
 block discarded – undo
811 811
 					if ($e->nodeName == "iframe") {
812 812
 						$matches = [];
813 813
 						if ($rrr = preg_match("/\/embed\/([\w-]+)/", $e->getAttribute("src"), $matches)) {
814
-							$article_image = "https://img.youtube.com/vi/" . $matches[1] . "/hqdefault.jpg";
815
-							$article_stream = "https://youtu.be/" . $matches[1];
814
+							$article_image = "https://img.youtube.com/vi/".$matches[1]."/hqdefault.jpg";
815
+							$article_stream = "https://youtu.be/".$matches[1];
816 816
 							break;
817 817
 						}
818 818
 					} else if ($e->nodeName == "video") {
Please login to merge, or discard this patch.
classes/feeds.php 1 patch
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -2,8 +2,8 @@  discard block
 block discarded – undo
2 2
 require_once "colors.php";
3 3
 
4 4
 class Feeds extends Handler_Protected {
5
-	const NEVER_GROUP_FEEDS = [ -6, 0 ];
6
-	const NEVER_GROUP_BY_DATE = [ -2, -1, -3 ];
5
+	const NEVER_GROUP_FEEDS = [ -6, 0];
6
+	const NEVER_GROUP_BY_DATE = [ -2, -1, -3];
7 7
 
8 8
     private $params;
9 9
 
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 
28 28
 		$reply = "";
29 29
 
30
-		$rss_link = htmlspecialchars(get_self_url_prefix() .
30
+		$rss_link = htmlspecialchars(get_self_url_prefix().
31 31
 			"/public.php?op=rss&id=$feed_id$cat_q$search_q");
32 32
 
33 33
 		$reply .= "<span class='left'>";
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 		}
50 50
 
51 51
 		if ($error)
52
-			$reply .= " <i title=\"" . htmlspecialchars($error) . "\" class='material-icons icon-error'>error</i>";
52
+			$reply .= " <i title=\"".htmlspecialchars($error)."\" class='material-icons icon-error'>error</i>";
53 53
 
54 54
 		$reply .= "</span>";
55 55
 		$reply .= "<span id='feed_current_unread' style='display: none'></span>";
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
             $sth->execute([$feed]);
140 140
 		}
141 141
 
142
-		if ($method_split[0] == "MarkAllReadGR")  {
142
+		if ($method_split[0] == "MarkAllReadGR") {
143 143
 			$this->catchup_feed($method_split[1], false);
144 144
 		}
145 145
 
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 				if (!get_pref('SHOW_CONTENT_PREVIEW')) {
244 244
 					$line["content_preview"] = "";
245 245
 				} else {
246
-					$line["content_preview"] =  "&mdash; " . truncate_string(strip_tags($line["content"]), 250);
246
+					$line["content_preview"] = "&mdash; ".truncate_string(strip_tags($line["content"]), 250);
247 247
 
248 248
 					foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_QUERY_HEADLINES) as $p) {
249 249
 						$line = $p->hook_query_headlines($line, 250, false);
@@ -322,10 +322,10 @@  discard block
 block discarded – undo
322 322
                 if (!get_pref("CDM_EXPANDED")) {
323 323
                     $line["cdm_excerpt"] = "<span class='collapse'>
324 324
                         <i class='material-icons' onclick='return Article.cdmUnsetActive(event)'
325
-                            title=\"" . __("Collapse article") . "\">remove_circle</i></span>";
325
+                            title=\"" . __("Collapse article")."\">remove_circle</i></span>";
326 326
 
327 327
                     if (get_pref('SHOW_CONTENT_PREVIEW')) {
328
-                        $line["cdm_excerpt"] .= "<span class='excerpt'>" . $line["content_preview"] . "</span>";
328
+                        $line["cdm_excerpt"] .= "<span class='excerpt'>".$line["content_preview"]."</span>";
329 329
                     }
330 330
                 }
331 331
 
@@ -339,11 +339,11 @@  discard block
 block discarded – undo
339 339
                     $ofgh->execute([$line["orig_feed_id"], $_SESSION['uid']]);
340 340
 
341 341
                     if ($tmp_line = $ofgh->fetch()) {
342
-                        $line["orig_feed"] = [ $tmp_line["title"], $tmp_line["site_url"], $tmp_line["feed_url"] ];
342
+                        $line["orig_feed"] = [$tmp_line["title"], $tmp_line["site_url"], $tmp_line["feed_url"]];
343 343
                     }
344 344
                 }
345 345
 
346
-				$line["updated_long"] = make_local_datetime($line["updated"],true);
346
+				$line["updated_long"] = make_local_datetime($line["updated"], true);
347 347
 				$line["updated"] = make_local_datetime($line["updated"], false, false, false, true);
348 348
 
349 349
 
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
 				}
378 378
 
379 379
 				if (isset($rgba_cache[$feed_id])) {
380
-				    $line['feed_bg_color'] = 'rgba(' . implode(",", $rgba_cache[$feed_id]) . ',0.3)';
380
+				    $line['feed_bg_color'] = 'rgba('.implode(",", $rgba_cache[$feed_id]).',0.3)';
381 381
                 }
382 382
 
383 383
 				/* we don't need those */
@@ -421,7 +421,7 @@  discard block
 block discarded – undo
421 421
 
422 422
 					$reply['content'] .= "<p><span class=\"text-muted\">";
423 423
 
424
-					$sth = $this->pdo->prepare("SELECT " . SUBSTRING_FOR_DATE . "(MAX(last_updated), 1, 19) AS last_updated FROM ttrss_feeds
424
+					$sth = $this->pdo->prepare("SELECT ".SUBSTRING_FOR_DATE."(MAX(last_updated), 1, 19) AS last_updated FROM ttrss_feeds
425 425
                         WHERE owner_uid = ?");
426 426
 					$sth->execute([$_SESSION['uid']]);
427 427
 					$row = $sth->fetch();
@@ -439,8 +439,8 @@  discard block
 block discarded – undo
439 439
 
440 440
 					if ($num_errors > 0) {
441 441
 						$reply['content'] .= "<br/>";
442
-						$reply['content'] .= "<a class=\"text-muted\" href=\"#\" onclick=\"CommonDialogs.showFeedsWithErrors()\">" .
443
-							__('Some feeds have update errors (click for details)') . "</a>";
442
+						$reply['content'] .= "<a class=\"text-muted\" href=\"#\" onclick=\"CommonDialogs.showFeedsWithErrors()\">".
443
+							__('Some feeds have update errors (click for details)')."</a>";
444 444
 					}
445 445
 					$reply['content'] .= "</span></p></div>";
446 446
 
@@ -635,7 +635,7 @@  discard block
 block discarded – undo
635 635
 		$reply['headlines']['is_cat'] = false;
636 636
 
637 637
 		$reply['headlines']['toolbar'] = '';
638
-		$reply['headlines']['content'] = "<div class='whiteBox'>". $error . "</div>";
638
+		$reply['headlines']['content'] = "<div class='whiteBox'>".$error."</div>";
639 639
 
640 640
 		$reply['headlines-info'] = array("count" => 0,
641 641
 			"unread" => 0,
@@ -669,7 +669,7 @@  discard block
 block discarded – undo
669 669
 		print "<fieldset>";
670 670
 
671 671
 		if (get_pref('ENABLE_FEED_CATS')) {
672
-			print "<label class='inline'>" . __('Place in category:') . "</label> ";
672
+			print "<label class='inline'>".__('Place in category:')."</label> ";
673 673
 			print_feed_cat_select("cat", false, 'dojoType="fox.form.Select"');
674 674
 		}
675 675
 
@@ -678,7 +678,7 @@  discard block
 block discarded – undo
678 678
 		print "</section>";
679 679
 
680 680
 		print '<div id="feedDlg_feedsContainer" style="display : none">
681
-				<header>' . __('Available feeds') . '</header>
681
+				<header>' . __('Available feeds').'</header>
682 682
 				<section>
683 683
 					<fieldset>
684 684
 						<select id="feedDlg_feedContainerSelect"
@@ -743,7 +743,7 @@  discard block
 block discarded – undo
743 743
 
744 744
 		if (DB_TYPE == "pgsql") {
745 745
 			print "<fieldset>";
746
-			print "<label class='inline'>" . __("Language:") . "</label>";
746
+			print "<label class='inline'>".__("Language:")."</label>";
747 747
 			print_select("search_language", get_pref('DEFAULT_SEARCH_LANGUAGE'), Pref_Feeds::get_ts_languages(),
748 748
 				"dojoType='fox.form.Select' title=\"".__('Used for word stemming')."\"");
749 749
 			print "</fieldset>";
@@ -772,7 +772,7 @@  discard block
 block discarded – undo
772 772
 		Debug::set_enabled(true);
773 773
 		Debug::set_loglevel($_REQUEST["xdebug"]);
774 774
 
775
-		$feed_id = (int)$_REQUEST["feed_id"];
775
+		$feed_id = (int) $_REQUEST["feed_id"];
776 776
 		@$do_update = $_REQUEST["action"] == "do_update";
777 777
 		$csrf_token = $_REQUEST["csrf_token"];
778 778
 
@@ -811,7 +811,7 @@  discard block
 block discarded – undo
811 811
 		</script>
812 812
 
813 813
 			<div class="container">
814
-				<h1>Feed Debugger: <?php echo "$feed_id: " . $this->getFeedTitle($feed_id) ?></h1>
814
+				<h1>Feed Debugger: <?php echo "$feed_id: ".$this->getFeedTitle($feed_id) ?></h1>
815 815
 				<div class="content">
816 816
 					<form method="GET" action="">
817 817
 						<input type="hidden" name="op" value="feeds">
@@ -1074,7 +1074,7 @@  discard block
 block discarded – undo
1074 1074
 		} else if ($n_feed >= 0) {
1075 1075
 
1076 1076
 			if ($n_feed != 0) {
1077
-				$match_part = "feed_id = " . (int)$n_feed;
1077
+				$match_part = "feed_id = ".(int) $n_feed;
1078 1078
 			} else {
1079 1079
 				$match_part = "feed_id IS NULL";
1080 1080
 			}
@@ -1184,7 +1184,7 @@  discard block
 block discarded – undo
1184 1184
 					(owner_uid,feed_url,title,cat_id, auth_login,auth_pass,update_method,auth_pass_encrypted)
1185 1185
 				VALUES (?, ?, ?, ?, ?, ?, 0, false)");
1186 1186
 
1187
-			$sth->execute([$_SESSION['uid'], $url, "[Unknown]", $cat_id, (string)$auth_login, (string)$auth_pass]);
1187
+			$sth->execute([$_SESSION['uid'], $url, "[Unknown]", $cat_id, (string) $auth_login, (string) $auth_pass]);
1188 1188
 
1189 1189
 			$sth = $pdo->prepare("SELECT id FROM ttrss_feeds WHERE feed_url = ?
1190 1190
 					AND owner_uid = ?");
@@ -1203,11 +1203,11 @@  discard block
 block discarded – undo
1203 1203
 	}
1204 1204
 
1205 1205
 	static function getIconFile($feed_id) {
1206
-		return ICONS_DIR . "/$feed_id.ico";
1206
+		return ICONS_DIR."/$feed_id.ico";
1207 1207
 	}
1208 1208
 
1209 1209
 	static function feedHasIcon($id) {
1210
-		return is_file(ICONS_DIR . "/$id.ico") && filesize(ICONS_DIR . "/$id.ico") > 0;
1210
+		return is_file(ICONS_DIR."/$id.ico") && filesize(ICONS_DIR."/$id.ico") > 0;
1211 1211
 	}
1212 1212
 
1213 1213
 	static function getFeedIcon($id) {
@@ -1237,7 +1237,7 @@  discard block
 block discarded – undo
1237 1237
 					$icon = self::getIconFile($id);
1238 1238
 
1239 1239
                     if ($icon && file_exists($icon)) {
1240
-						return ICONS_URL . "/" . basename($icon) . "?" . filemtime($icon);
1240
+						return ICONS_URL."/".basename($icon)."?".filemtime($icon);
1241 1241
 					}
1242 1242
 				}
1243 1243
 				break;
@@ -1310,7 +1310,7 @@  discard block
 block discarded – undo
1310 1310
 
1311 1311
 			$cat_feeds = array();
1312 1312
 			while ($line = $sth->fetch()) {
1313
-				array_push($cat_feeds, "feed_id = " . (int)$line["id"]);
1313
+				array_push($cat_feeds, "feed_id = ".(int) $line["id"]);
1314 1314
 			}
1315 1315
 
1316 1316
 			if (count($cat_feeds) == 0) return 0;
@@ -1524,7 +1524,7 @@  discard block
 block discarded – undo
1524 1524
 		}
1525 1525
 
1526 1526
 		if ($limit > 0) {
1527
-			$limit_query_part = "LIMIT " . (int)$limit;
1527
+			$limit_query_part = "LIMIT ".(int) $limit;
1528 1528
 		}
1529 1529
 
1530 1530
 		$allow_archived = false;
@@ -1551,7 +1551,7 @@  discard block
 block discarded – undo
1551 1551
 							implode(",", $subcats).")";
1552 1552
 
1553 1553
 					} else {
1554
-						$query_strategy_part = "cat_id = " . $pdo->quote($feed);
1554
+						$query_strategy_part = "cat_id = ".$pdo->quote($feed);
1555 1555
 					}
1556 1556
 
1557 1557
 				} else {
@@ -1561,7 +1561,7 @@  discard block
 block discarded – undo
1561 1561
 				$vfeed_query_part = "ttrss_feeds.title AS feed_title,";
1562 1562
 
1563 1563
 			} else {
1564
-				$query_strategy_part = "feed_id = " . $pdo->quote($feed);
1564
+				$query_strategy_part = "feed_id = ".$pdo->quote($feed);
1565 1565
 			}
1566 1566
 		} else if ($feed == 0 && !$cat_view) { // archive virtual feed
1567 1567
 			$query_strategy_part = "feed_id IS NULL";
@@ -1683,7 +1683,7 @@  discard block
 block discarded – undo
1683 1683
 		$content_query_part = "content, ";
1684 1684
 
1685 1685
 		if ($limit_query_part) {
1686
-			$offset_query_part = "OFFSET " . (int)$offset;
1686
+			$offset_query_part = "OFFSET ".(int) $offset;
1687 1687
 		} else {
1688 1688
 			$offset_query_part = "";
1689 1689
 		}
@@ -1772,7 +1772,7 @@  discard block
 block discarded – undo
1772 1772
 				$res = $pdo->query($query);
1773 1773
 
1774 1774
 				if ($row = $res->fetch()) {
1775
-					$first_id = (int)$row["id"];
1775
+					$first_id = (int) $row["id"];
1776 1776
 
1777 1777
 					if ($offset > 0 && $first_id && $check_first_id && $first_id != $check_first_id) {
1778 1778
 						return array(-1, $feed_title, $feed_site_url, $last_error, $last_updated, $search_words, $first_id, $vfeed_query_part != "", $query_error_override);
@@ -1919,9 +1919,9 @@  discard block
 block discarded – undo
1919 1919
 	}
1920 1920
 
1921 1921
     function color_of($name) {
1922
-        $colormap = [ "#1cd7d7","#d91111","#1212d7","#8e16e5","#7b7b7b",
1923
-            "#39f110","#0bbea6","#ec0e0e","#1534f2","#b9e416",
1924
-            "#479af2","#f36b14","#10c7e9","#1e8fe7","#e22727" ];
1922
+        $colormap = ["#1cd7d7", "#d91111", "#1212d7", "#8e16e5", "#7b7b7b",
1923
+            "#39f110", "#0bbea6", "#ec0e0e", "#1534f2", "#b9e416",
1924
+            "#479af2", "#f36b14", "#10c7e9", "#1e8fe7", "#e22727"];
1925 1925
 
1926 1926
         $sum = 0;
1927 1927
 
@@ -1985,13 +1985,13 @@  discard block
 block discarded – undo
1985 1985
 
1986 1986
 		// support schema-less urls
1987 1987
 		if (strpos($url, '//') === 0) {
1988
-			$url = 'https:' . $url;
1988
+			$url = 'https:'.$url;
1989 1989
 		}
1990 1990
 
1991 1991
 		if (strpos($url, '://') === false) {
1992
-			$url = 'http://' . $url;
1992
+			$url = 'http://'.$url;
1993 1993
 		} else if (substr($url, 0, 5) == 'feed:') {
1994
-			$url = 'http:' . substr($url, 5);
1994
+			$url = 'http:'.substr($url, 5);
1995 1995
 		}
1996 1996
 
1997 1997
 		//prepend slash if the URL has no slash in it
@@ -2041,7 +2041,7 @@  discard block
 block discarded – undo
2041 2041
 
2042 2042
 			$sth = $pdo->prepare("INSERT INTO ttrss_feed_categories (owner_uid,title,parent_cat,order_id)
2043 2043
 					VALUES (?, ?, ?, ?)");
2044
-			$sth->execute([$_SESSION['uid'], $feed_cat, $parent_cat_id, (int)$order_id]);
2044
+			$sth->execute([$_SESSION['uid'], $feed_cat, $parent_cat_id, (int) $order_id]);
2045 2045
 
2046 2046
 			if (!$tr_in_progress) $pdo->commit();
2047 2047
 
@@ -2141,7 +2141,7 @@  discard block
 block discarded – undo
2141 2141
 			$sth->execute([$feed_id]);
2142 2142
 
2143 2143
 		} else {
2144
-			$sth  = $pdo->prepare("DELETE FROM ttrss_user_entries
2144
+			$sth = $pdo->prepare("DELETE FROM ttrss_user_entries
2145 2145
 				USING ttrss_user_entries, ttrss_entries
2146 2146
 				WHERE ttrss_entries.id = ref_id AND
2147 2147
 				marked = false AND
@@ -2211,7 +2211,7 @@  discard block
 block discarded – undo
2211 2211
 				case "title":
2212 2212
 					if ($commandpair[1]) {
2213 2213
 						array_push($query_keywords, "($not (LOWER(ttrss_entries.title) LIKE ".
2214
-							$pdo->quote('%' . mb_strtolower($commandpair[1]) . '%') ."))");
2214
+							$pdo->quote('%'.mb_strtolower($commandpair[1]).'%')."))");
2215 2215
 					} else {
2216 2216
 						array_push($query_keywords, "(UPPER(ttrss_entries.title) $not LIKE UPPER('%$k%')
2217 2217
 								OR UPPER(ttrss_entries.content) $not LIKE UPPER(".$pdo->quote("%$k%")."))");
@@ -2221,7 +2221,7 @@  discard block
 block discarded – undo
2221 2221
 				case "author":
2222 2222
 					if ($commandpair[1]) {
2223 2223
 						array_push($query_keywords, "($not (LOWER(author) LIKE ".
2224
-							$pdo->quote('%' . mb_strtolower($commandpair[1]) . '%')."))");
2224
+							$pdo->quote('%'.mb_strtolower($commandpair[1]).'%')."))");
2225 2225
 					} else {
2226 2226
 						array_push($query_keywords, "(UPPER(ttrss_entries.title) $not LIKE UPPER('%$k%')
2227 2227
 								OR UPPER(ttrss_entries.content) $not LIKE UPPER(".$pdo->quote("%$k%")."))");
@@ -2236,7 +2236,7 @@  discard block
 block discarded – undo
2236 2236
 							array_push($query_keywords, "($not (note IS NULL OR note = ''))");
2237 2237
 						else
2238 2238
 							array_push($query_keywords, "($not (LOWER(note) LIKE ".
2239
-								$pdo->quote('%' . mb_strtolower($commandpair[1]) . '%')."))");
2239
+								$pdo->quote('%'.mb_strtolower($commandpair[1]).'%')."))");
2240 2240
 					} else {
2241 2241
 						array_push($query_keywords, "(UPPER(ttrss_entries.title) $not LIKE UPPER(".$pdo->quote("%$k%").")
2242 2242
 								OR UPPER(ttrss_entries.content) $not LIKE UPPER(".$pdo->quote("%$k%")."))");
@@ -2313,7 +2313,7 @@  discard block
 block discarded – undo
2313 2313
 
2314 2314
 				// if there's no joiners consider this a "simple" search and
2315 2315
 				// concatenate everything with &, otherwise don't try to mess with tsquery syntax
2316
-				if (preg_match("/[&|]/", implode(" " , $search_query_leftover))) {
2316
+				if (preg_match("/[&|]/", implode(" ", $search_query_leftover))) {
2317 2317
 					$tsquery = $pdo->quote(implode(" ", $search_query_leftover));
2318 2318
 				} else {
2319 2319
 					$tsquery = $pdo->quote(implode(" & ", $search_query_leftover));
Please login to merge, or discard this patch.
classes/dbupdater.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,9 +52,9 @@
 block discarded – undo
52 52
 							$this->pdo->query($line); // PDO returns errors as exceptions now
53 53
 						} catch (PDOException $e) {
54 54
 							if ($html_output) {
55
-								print "<div class='text-error'>Error: " . $e->getMessage() . "</div>";
55
+								print "<div class='text-error'>Error: ".$e->getMessage()."</div>";
56 56
 							} else {
57
-								Debug::log("Error: " . $e->getMessage());
57
+								Debug::log("Error: ".$e->getMessage());
58 58
 							}
59 59
 
60 60
 							$this->pdo->rollBack();
Please login to merge, or discard this patch.
install/index.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 		$query = "";
12 12
 
13 13
 		if (!(strpos($filename, "?") === FALSE)) {
14
-			$query = substr($filename, strpos($filename, "?")+1);
14
+			$query = substr($filename, strpos($filename, "?") + 1);
15 15
 			$filename = substr($filename, 0, strpos($filename, "?"));
16 16
 		}
17 17
 
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 		$errors = array();
86 86
 
87 87
 		if (version_compare(PHP_VERSION, '5.6.0', '<')) {
88
-			array_push($errors, "PHP version 5.6.0 or newer required. You're using " . PHP_VERSION . ".");
88
+			array_push($errors, "PHP version 5.6.0 or newer required. You're using ".PHP_VERSION.".");
89 89
 		}
90 90
 
91 91
 		if (!function_exists("curl_init") && !ini_get("allow_url_fopen")) {
@@ -133,17 +133,17 @@  discard block
 block discarded – undo
133 133
 
134 134
 	function pdo_connect($host, $user, $pass, $db, $type, $port = false) {
135 135
 
136
-		$db_port = $port ? ';port=' . $port : '';
137
-		$db_host = $host ? ';host=' . $host : '';
136
+		$db_port = $port ? ';port='.$port : '';
137
+		$db_host = $host ? ';host='.$host : '';
138 138
 
139 139
 		try {
140
-			$pdo = new PDO($type . ':dbname=' . $db . $db_host . $db_port,
140
+			$pdo = new PDO($type.':dbname='.$db.$db_host.$db_port,
141 141
 				$user,
142 142
 				$pass);
143 143
 
144 144
 			return $pdo;
145 145
 		} catch (Exception $e) {
146
-		    print "<div class='alert alert-danger'>" . $e->getMessage() . "</div>";
146
+		    print "<div class='alert alert-danger'>".$e->getMessage()."</div>";
147 147
 		    return null;
148 148
         }
149 149
 	}
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 	}
190 190
 
191 191
 	function make_self_url_path() {
192
-		$url_path = (is_server_https() ? 'https://' :  'http://') . $_SERVER["HTTP_HOST"] . parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH);
192
+		$url_path = (is_server_https() ? 'https://' : 'http://').$_SERVER["HTTP_HOST"].parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH);
193 193
 
194 194
 		return $url_path;
195 195
 	}
@@ -437,7 +437,7 @@  discard block
 block discarded – undo
437 437
 
438 438
 						if (!$res) {
439 439
 							print_notice("Query: $line");
440
-							print_error("Error: " . implode(", ", $pdo->errorInfo()));
440
+							print_error("Error: ".implode(", ", $pdo->errorInfo()));
441 441
                         }
442 442
 					}
443 443
 				}
Please login to merge, or discard this patch.
update_daemon2.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@  discard block
 block discarded – undo
1 1
 #!/usr/bin/env php
2 2
 <?php
3
-	set_include_path(dirname(__FILE__) ."/include" . PATH_SEPARATOR .
3
+	set_include_path(dirname(__FILE__)."/include".PATH_SEPARATOR.
4 4
 		get_include_path());
5 5
 
6
-	declare(ticks = 1);
6
+	declare(ticks=1);
7 7
 	chdir(dirname(__FILE__));
8 8
 
9 9
 	define('DISABLE_SESSIONS', true);
@@ -99,9 +99,9 @@  discard block
 block discarded – undo
99 99
 
100 100
 	function shutdown($caller_pid) {
101 101
 		if ($caller_pid == posix_getpid()) {
102
-			if (file_exists(LOCK_DIRECTORY . "/update_daemon.lock")) {
102
+			if (file_exists(LOCK_DIRECTORY."/update_daemon.lock")) {
103 103
 				Debug::log("removing lockfile (master)...");
104
-				unlink(LOCK_DIRECTORY . "/update_daemon.lock");
104
+				unlink(LOCK_DIRECTORY."/update_daemon.lock");
105 105
 			}
106 106
 		}
107 107
 	}
@@ -109,9 +109,9 @@  discard block
 block discarded – undo
109 109
 	function task_shutdown() {
110 110
 		$pid = posix_getpid();
111 111
 
112
-		if (file_exists(LOCK_DIRECTORY . "/update_daemon-$pid.lock")) {
112
+		if (file_exists(LOCK_DIRECTORY."/update_daemon-$pid.lock")) {
113 113
 			Debug::log("removing lockfile ($pid)...");
114
-			unlink(LOCK_DIRECTORY . "/update_daemon-$pid.lock");
114
+			unlink(LOCK_DIRECTORY."/update_daemon-$pid.lock");
115 115
 		}
116 116
 	}
117 117
 
@@ -138,15 +138,15 @@  discard block
 block discarded – undo
138 138
 
139 139
 	$options = getopt("", $longopts);
140 140
 
141
-	if (isset($options["help"]) ) {
141
+	if (isset($options["help"])) {
142 142
 		print "Tiny Tiny RSS update daemon.\n\n";
143 143
 		print "Options:\n";
144 144
 		print "  --log FILE           - log messages to FILE\n";
145 145
         print "  --log-level N        - log verbosity level\n";
146 146
 		print "  --tasks N            - amount of update tasks to spawn\n";
147
-		print "                         default: " . MAX_JOBS . "\n";
147
+		print "                         default: ".MAX_JOBS."\n";
148 148
 		print "  --interval N         - task spawn interval\n";
149
-		print "                         default: " . SPAWN_INTERVAL . " seconds.\n";
149
+		print "                         default: ".SPAWN_INTERVAL." seconds.\n";
150 150
 		print "  --quiet              - don't output messages to stdout\n";
151 151
 		return;
152 152
 	}
@@ -154,13 +154,13 @@  discard block
 block discarded – undo
154 154
     Debug::set_enabled(true);
155 155
 
156 156
     if (isset($options["log-level"])) {
157
-        Debug::set_loglevel((int)$options["log-level"]);
157
+        Debug::set_loglevel((int) $options["log-level"]);
158 158
     }
159 159
 
160 160
     if (isset($options["log"])) {
161 161
         Debug::set_quiet(isset($options['quiet']));
162 162
         Debug::set_logfile($options["log"]);
163
-        Debug::log("Logging to " . $options["log"]);
163
+        Debug::log("Logging to ".$options["log"]);
164 164
     } else {
165 165
         if (isset($options['quiet'])) {
166 166
             Debug::set_loglevel(Debug::$LOG_DISABLED);
@@ -168,14 +168,14 @@  discard block
 block discarded – undo
168 168
     }
169 169
 
170 170
 	if (isset($options["tasks"])) {
171
-		Debug::log("Set to spawn " . $options["tasks"] . " children.");
171
+		Debug::log("Set to spawn ".$options["tasks"]." children.");
172 172
 		$max_jobs = $options["tasks"];
173 173
 	} else {
174 174
 		$max_jobs = MAX_JOBS;
175 175
 	}
176 176
 
177 177
 	if (isset($options["interval"])) {
178
-		Debug::log("Spawn interval: " . $options["interval"] . " seconds.");
178
+		Debug::log("Spawn interval: ".$options["interval"]." seconds.");
179 179
 		$spawn_interval = $options["interval"];
180 180
 	} else {
181 181
 		$spawn_interval = SPAWN_INTERVAL;
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
 
251 251
 					$my_pid = posix_getpid();
252 252
 
253
-					passthru(PHP_EXECUTABLE . " update.php --daemon-loop $quiet $log --task $j --pidlock $my_pid");
253
+					passthru(PHP_EXECUTABLE." update.php --daemon-loop $quiet $log --task $j --pidlock $my_pid");
254 254
 
255 255
 					sleep(1);
256 256
 
Please login to merge, or discard this patch.
errors.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,15 +1,15 @@
 block discarded – undo
1 1
 <?php
2
-	set_include_path(dirname(__FILE__) ."/include" . PATH_SEPARATOR .
2
+	set_include_path(dirname(__FILE__)."/include".PATH_SEPARATOR.
3 3
 		get_include_path());
4 4
 
5 5
 	require_once "functions.php";
6 6
 
7 7
 	$ERRORS[0] = "";
8 8
 
9
-	$ERRORS[1] = __("This program requires XmlHttpRequest " .
9
+	$ERRORS[1] = __("This program requires XmlHttpRequest ".
10 10
 			"to function properly. Your browser doesn't seem to support it.");
11 11
 
12
-	$ERRORS[2] = __("This program requires cookies " .
12
+	$ERRORS[2] = __("This program requires cookies ".
13 13
 			"to function properly. Your browser doesn't seem to support them.");
14 14
 
15 15
 	$ERRORS[3] = __("Backend sanity check failed.");
Please login to merge, or discard this patch.
opml.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-	set_include_path(dirname(__FILE__) ."/include" . PATH_SEPARATOR .
2
+	set_include_path(dirname(__FILE__)."/include".PATH_SEPARATOR.
3 3
 		get_include_path());
4 4
 
5 5
 	require_once "autoload.php";
@@ -14,11 +14,11 @@  discard block
 block discarded – undo
14 14
 
15 15
 	$op = $_REQUEST['op'];
16 16
 
17
-	if ($op == "publish"){
17
+	if ($op == "publish") {
18 18
 		$key = $_REQUEST["key"];
19 19
 		$pdo = Db::pdo();
20 20
 
21
-		$sth = $pdo->prepare( "SELECT owner_uid
21
+		$sth = $pdo->prepare("SELECT owner_uid
22 22
 				FROM ttrss_access_keys WHERE
23 23
 				access_key = ? AND feed_id = 'OPML:Publish'");
24 24
 		$sth->execute([$key]);
Please login to merge, or discard this patch.