@@ -7,11 +7,11 @@ discard block |
||
7 | 7 | if ($k != "feed" && isset($v)) { |
8 | 8 | $x = strip_tags(is_array($v) ? implode(",", $v) : $v); |
9 | 9 | |
10 | - $tmp .= sha1("$k:" . sha1($x)); |
|
10 | + $tmp .= sha1("$k:".sha1($x)); |
|
11 | 11 | } |
12 | 12 | } |
13 | 13 | |
14 | - return sha1(implode(",", $pluginhost->get_plugin_names()) . $tmp); |
|
14 | + return sha1(implode(",", $pluginhost->get_plugin_names()).$tmp); |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | // Strips utf8mb4 characters (i.e. emoji) for mysql |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | //update_rss_feed($line["id"], true); |
138 | 138 | |
139 | 139 | if ($tline = $usth->fetch()) { |
140 | - Debug::log(" => " . $tline["last_updated"] . ", " . $tline["id"] . " " . $tline["owner_uid"]); |
|
140 | + Debug::log(" => ".$tline["last_updated"].", ".$tline["id"]." ".$tline["owner_uid"]); |
|
141 | 141 | |
142 | 142 | if (array_search($tline["owner_uid"], $batch_owners) === FALSE) |
143 | 143 | array_push($batch_owners, $tline["owner_uid"]); |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | |
324 | 324 | $date_feed_processed = date('Y-m-d H:i'); |
325 | 325 | |
326 | - $cache_filename = CACHE_DIR . "/feeds/" . sha1($fetch_url) . ".xml"; |
|
326 | + $cache_filename = CACHE_DIR."/feeds/".sha1($fetch_url).".xml"; |
|
327 | 327 | |
328 | 328 | $pluginhost = new PluginHost(); |
329 | 329 | $user_plugins = get_pref("_ENABLED_PLUGINS", $owner_uid); |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | Debug::log("running HOOK_FETCH_FEED handlers...", Debug::$LOG_VERBOSE); |
341 | 341 | |
342 | 342 | foreach ($pluginhost->get_hooks(PluginHost::HOOK_FETCH_FEED) as $plugin) { |
343 | - Debug::log("... " . get_class($plugin), Debug::$LOG_VERBOSE); |
|
343 | + Debug::log("... ".get_class($plugin), Debug::$LOG_VERBOSE); |
|
344 | 344 | $start = microtime(true); |
345 | 345 | $feed_data = $plugin->hook_fetch_feed($feed_data, $fetch_url, $owner_uid, $feed, 0, $auth_login, $auth_pass); |
346 | 346 | Debug::log(sprintf("=== %.4f (sec)", microtime(true) - $start), Debug::$LOG_VERBOSE); |
@@ -402,7 +402,7 @@ discard block |
||
402 | 402 | $feed_data = trim($feed_data); |
403 | 403 | |
404 | 404 | Debug::log("fetch done.", Debug::$LOG_VERBOSE); |
405 | - Debug::log("source last modified: " . $fetch_last_modified, Debug::$LOG_VERBOSE); |
|
405 | + Debug::log("source last modified: ".$fetch_last_modified, Debug::$LOG_VERBOSE); |
|
406 | 406 | |
407 | 407 | if ($feed_data && $fetch_last_modified != $stored_last_modified) { |
408 | 408 | $sth = $pdo->prepare("UPDATE ttrss_feeds SET last_modified = ? WHERE id = ?"); |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | } |
411 | 411 | |
412 | 412 | // cache vanilla feed data for re-use |
413 | - if ($feed_data && !$auth_pass && !$auth_login && is_writable(CACHE_DIR . "/feeds")) { |
|
413 | + if ($feed_data && !$auth_pass && !$auth_login && is_writable(CACHE_DIR."/feeds")) { |
|
414 | 414 | $new_rss_hash = sha1($feed_data); |
415 | 415 | |
416 | 416 | if ($new_rss_hash != $rss_hash) { |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | $feed_data_checksum = md5($feed_data); |
446 | 446 | |
447 | 447 | foreach ($pluginhost->get_hooks(PluginHost::HOOK_FEED_FETCHED) as $plugin) { |
448 | - Debug::log("... " . get_class($plugin), Debug::$LOG_VERBOSE); |
|
448 | + Debug::log("... ".get_class($plugin), Debug::$LOG_VERBOSE); |
|
449 | 449 | $start = microtime(true); |
450 | 450 | $feed_data = $plugin->hook_feed_fetched($feed_data, $fetch_url, $owner_uid, $feed); |
451 | 451 | Debug::log(sprintf("=== %.4f (sec)", microtime(true) - $start), Debug::$LOG_VERBOSE); |
@@ -467,7 +467,7 @@ discard block |
||
467 | 467 | // We use local pluginhost here because we need to load different per-user feed plugins |
468 | 468 | |
469 | 469 | foreach ($pluginhost->get_hooks(PluginHost::HOOK_FEED_PARSED) as $plugin) { |
470 | - Debug::log("... " . get_class($plugin), Debug::$LOG_VERBOSE); |
|
470 | + Debug::log("... ".get_class($plugin), Debug::$LOG_VERBOSE); |
|
471 | 471 | $start = microtime(true); |
472 | 472 | $plugin->hook_feed_parsed($rss); |
473 | 473 | Debug::log(sprintf("=== %.4f (sec)", microtime(true) - $start), Debug::$LOG_VERBOSE); |
@@ -499,14 +499,14 @@ discard block |
||
499 | 499 | $site_url = mb_substr(rewrite_relative_url($fetch_url, clean($rss->get_link())), 0, 245); |
500 | 500 | |
501 | 501 | Debug::log("site_url: $site_url", Debug::$LOG_VERBOSE); |
502 | - Debug::log("feed_title: " . clean($rss->get_title()), Debug::$LOG_VERBOSE); |
|
502 | + Debug::log("feed_title: ".clean($rss->get_title()), Debug::$LOG_VERBOSE); |
|
503 | 503 | |
504 | 504 | if ($favicon_needs_check || $force_refetch) { |
505 | 505 | |
506 | 506 | /* terrible hack: if we crash on floicon shit here, we won't check |
507 | 507 | * the icon avgcolor again (unless the icon got updated) */ |
508 | 508 | |
509 | - $favicon_file = ICONS_DIR . "/$feed.ico"; |
|
509 | + $favicon_file = ICONS_DIR."/$feed.ico"; |
|
510 | 510 | $favicon_modified = @filemtime($favicon_file); |
511 | 511 | |
512 | 512 | Debug::log("checking favicon...", Debug::$LOG_VERBOSE); |
@@ -527,7 +527,7 @@ discard block |
||
527 | 527 | |
528 | 528 | $favicon_color = calculate_avg_color($favicon_file); |
529 | 529 | |
530 | - $favicon_colorstring = ",favicon_avg_color = " . $pdo->quote($favicon_color); |
|
530 | + $favicon_colorstring = ",favicon_avg_color = ".$pdo->quote($favicon_color); |
|
531 | 531 | |
532 | 532 | } else if ($favicon_avg_color == 'fail') { |
533 | 533 | Debug::log("floicon failed on this file, not trying to recalculate avg color", Debug::$LOG_VERBOSE); |
@@ -546,7 +546,7 @@ discard block |
||
546 | 546 | print_r($filters); |
547 | 547 | } |
548 | 548 | |
549 | - Debug::log("" . count($filters) . " filters loaded.", Debug::$LOG_VERBOSE); |
|
549 | + Debug::log("".count($filters)." filters loaded.", Debug::$LOG_VERBOSE); |
|
550 | 550 | |
551 | 551 | $items = $rss->get_items(); |
552 | 552 | |
@@ -588,13 +588,13 @@ discard block |
||
588 | 588 | |
589 | 589 | $entry_guid = "$owner_uid,$entry_guid"; |
590 | 590 | |
591 | - $entry_guid_hashed = 'SHA1:' . sha1($entry_guid); |
|
591 | + $entry_guid_hashed = 'SHA1:'.sha1($entry_guid); |
|
592 | 592 | |
593 | 593 | Debug::log("guid $entry_guid / $entry_guid_hashed", Debug::$LOG_VERBOSE); |
594 | 594 | |
595 | - $entry_timestamp = (int)$item->get_date(); |
|
595 | + $entry_timestamp = (int) $item->get_date(); |
|
596 | 596 | |
597 | - Debug::log("orig date: " . $item->get_date(), Debug::$LOG_VERBOSE); |
|
597 | + Debug::log("orig date: ".$item->get_date(), Debug::$LOG_VERBOSE); |
|
598 | 598 | |
599 | 599 | $entry_title = strip_tags($item->get_title()); |
600 | 600 | |
@@ -606,7 +606,7 @@ discard block |
||
606 | 606 | Debug::log("link $entry_link", Debug::$LOG_VERBOSE); |
607 | 607 | Debug::log("language $entry_language", Debug::$LOG_VERBOSE); |
608 | 608 | |
609 | - if (!$entry_title) $entry_title = date("Y-m-d H:i:s", $entry_timestamp);; |
|
609 | + if (!$entry_title) $entry_title = date("Y-m-d H:i:s", $entry_timestamp); ; |
|
610 | 610 | |
611 | 611 | $entry_content = $item->get_content(); |
612 | 612 | if (!$entry_content) $entry_content = $item->get_description(); |
@@ -627,7 +627,7 @@ discard block |
||
627 | 627 | Debug::log("looking for tags...", Debug::$LOG_VERBOSE); |
628 | 628 | |
629 | 629 | $entry_tags = $item->get_categories(); |
630 | - Debug::log("tags found: " . join(", ", $entry_tags), Debug::$LOG_VERBOSE); |
|
630 | + Debug::log("tags found: ".join(", ", $entry_tags), Debug::$LOG_VERBOSE); |
|
631 | 631 | |
632 | 632 | Debug::log("done collecting data.", Debug::$LOG_VERBOSE); |
633 | 633 | |
@@ -692,14 +692,14 @@ discard block |
||
692 | 692 | Debug::log("hash differs, applying plugin filters:", Debug::$LOG_VERBOSE); |
693 | 693 | |
694 | 694 | foreach ($pluginhost->get_hooks(PluginHost::HOOK_ARTICLE_FILTER) as $plugin) { |
695 | - Debug::log("... " . get_class($plugin), Debug::$LOG_VERBOSE); |
|
695 | + Debug::log("... ".get_class($plugin), Debug::$LOG_VERBOSE); |
|
696 | 696 | |
697 | 697 | $start = microtime(true); |
698 | 698 | $article = $plugin->hook_article_filter($article); |
699 | 699 | |
700 | 700 | Debug::log(sprintf("=== %.4f (sec)", microtime(true) - $start), Debug::$LOG_VERBOSE); |
701 | 701 | |
702 | - $entry_plugin_data .= mb_strtolower(get_class($plugin)) . ","; |
|
702 | + $entry_plugin_data .= mb_strtolower(get_class($plugin)).","; |
|
703 | 703 | } |
704 | 704 | |
705 | 705 | if (Debug::get_loglevel() >= 3) { |
@@ -772,7 +772,7 @@ discard block |
||
772 | 772 | Debug::log("applying plugin filter actions...", Debug::$LOG_VERBOSE); |
773 | 773 | |
774 | 774 | foreach ($plugin_filter_names as $pfn) { |
775 | - list($pfclass,$pfaction) = explode(":", $pfn["param"]); |
|
775 | + list($pfclass, $pfaction) = explode(":", $pfn["param"]); |
|
776 | 776 | |
777 | 777 | if (isset($plugin_filter_actions[$pfclass])) { |
778 | 778 | $plugin = $pluginhost->get_plugin($pfclass); |
@@ -867,7 +867,7 @@ discard block |
||
867 | 867 | $entry_current_hash, |
868 | 868 | $date_feed_processed, |
869 | 869 | $entry_comments, |
870 | - (int)$num_comments, |
|
870 | + (int) $num_comments, |
|
871 | 871 | $entry_plugin_data, |
872 | 872 | "$entry_language", |
873 | 873 | "$entry_author"]); |
@@ -979,7 +979,7 @@ discard block |
||
979 | 979 | ":content" => "$entry_content", |
980 | 980 | ":content_hash" => $entry_current_hash, |
981 | 981 | ":updated" => $entry_timestamp_fmt, |
982 | - ":num_comments" => (int)$num_comments, |
|
982 | + ":num_comments" => (int) $num_comments, |
|
983 | 983 | ":plugin_data" => $entry_plugin_data, |
984 | 984 | ":author" => "$entry_author", |
985 | 985 | ":lang" => $entry_language, |
@@ -987,7 +987,7 @@ discard block |
||
987 | 987 | |
988 | 988 | if (DB_TYPE == "pgsql") { |
989 | 989 | $params[":ts_lang"] = $feed_language; |
990 | - $params[":ts_content"] = mb_substr(strip_tags($entry_title . " " . $entry_content), 0, 900000); |
|
990 | + $params[":ts_content"] = mb_substr(strip_tags($entry_title." ".$entry_content), 0, 900000); |
|
991 | 991 | } |
992 | 992 | |
993 | 993 | $sth->execute($params); |
@@ -1067,7 +1067,7 @@ discard block |
||
1067 | 1067 | foreach ($enclosures as $enc) { |
1068 | 1068 | $enc_url = $enc[0]; |
1069 | 1069 | $enc_type = $enc[1]; |
1070 | - $enc_dur = (int)$enc[2]; |
|
1070 | + $enc_dur = (int) $enc[2]; |
|
1071 | 1071 | $enc_title = $enc[3]; |
1072 | 1072 | $enc_width = intval($enc[4]); |
1073 | 1073 | $enc_height = intval($enc[5]); |
@@ -1075,7 +1075,7 @@ discard block |
||
1075 | 1075 | $esth->execute([$enc_url, $enc_type, $entry_ref_id]); |
1076 | 1076 | |
1077 | 1077 | if (!$esth->fetch()) { |
1078 | - $usth->execute([$enc_url, $enc_type, (string)$enc_title, $enc_dur, $entry_ref_id, $enc_width, $enc_height]); |
|
1078 | + $usth->execute([$enc_url, $enc_type, (string) $enc_title, $enc_dur, $entry_ref_id, $enc_width, $enc_height]); |
|
1079 | 1079 | } |
1080 | 1080 | } |
1081 | 1081 | |
@@ -1109,7 +1109,7 @@ discard block |
||
1109 | 1109 | $filtered_tags = array_unique($filtered_tags); |
1110 | 1110 | |
1111 | 1111 | if (Debug::get_loglevel() >= Debug::$LOG_VERBOSE) { |
1112 | - Debug::log("filtered tags: " . implode(", ", $filtered_tags), Debug::$LOG_VERBOSE); |
|
1112 | + Debug::log("filtered tags: ".implode(", ", $filtered_tags), Debug::$LOG_VERBOSE); |
|
1113 | 1113 | |
1114 | 1114 | } |
1115 | 1115 | |
@@ -1297,11 +1297,11 @@ discard block |
||
1297 | 1297 | $num_deleted = 0; |
1298 | 1298 | |
1299 | 1299 | if (is_writable(LOCK_DIRECTORY)) { |
1300 | - $files = glob(LOCK_DIRECTORY . "/*.lock"); |
|
1300 | + $files = glob(LOCK_DIRECTORY."/*.lock"); |
|
1301 | 1301 | |
1302 | 1302 | if ($files) { |
1303 | 1303 | foreach ($files as $file) { |
1304 | - if (!file_is_locked(basename($file)) && time() - filemtime($file) > 86400*2) { |
|
1304 | + if (!file_is_locked(basename($file)) && time() - filemtime($file) > 86400 * 2) { |
|
1305 | 1305 | unlink($file); |
1306 | 1306 | ++$num_deleted; |
1307 | 1307 | } |
@@ -1516,7 +1516,7 @@ discard block |
||
1516 | 1516 | static function check_feed_favicon($site_url, $feed) { |
1517 | 1517 | # print "FAVICON [$site_url]: $favicon_url\n"; |
1518 | 1518 | |
1519 | - $icon_file = ICONS_DIR . "/$feed.ico"; |
|
1519 | + $icon_file = ICONS_DIR."/$feed.ico"; |
|
1520 | 1520 | |
1521 | 1521 | if (!file_exists($icon_file)) { |
1522 | 1522 | $favicon_url = RSSUtils::get_favicon_url($site_url); |
@@ -1570,14 +1570,14 @@ discard block |
||
1570 | 1570 | |
1571 | 1571 | static function is_gzipped($feed_data) { |
1572 | 1572 | return strpos(substr($feed_data, 0, 3), |
1573 | - "\x1f" . "\x8b" . "\x08", 0) === 0; |
|
1573 | + "\x1f"."\x8b"."\x08", 0) === 0; |
|
1574 | 1574 | } |
1575 | 1575 | |
1576 | 1576 | static function load_filters($feed_id, $owner_uid) { |
1577 | 1577 | $filters = array(); |
1578 | 1578 | |
1579 | 1579 | $feed_id = (int) $feed_id; |
1580 | - $cat_id = (int)Feeds::getFeedCategory($feed_id); |
|
1580 | + $cat_id = (int) Feeds::getFeedCategory($feed_id); |
|
1581 | 1581 | |
1582 | 1582 | if ($cat_id == 0) |
1583 | 1583 | $null_cat_qpart = "cat_id IS NULL OR"; |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | time() - $preferred_ts <= 7200 |
38 | 38 | ) { |
39 | 39 | |
40 | - Debug::log("Sending digest for UID:" . $line['id'] . " - " . $line["email"]); |
|
40 | + Debug::log("Sending digest for UID:".$line['id']." - ".$line["email"]); |
|
41 | 41 | |
42 | 42 | $do_catchup = get_pref('DIGEST_CATCHUP', $line['id'], false); |
43 | 43 | |
@@ -123,13 +123,13 @@ discard block |
||
123 | 123 | |
124 | 124 | $sth = $pdo->prepare("SELECT ttrss_entries.title, |
125 | 125 | ttrss_feeds.title AS feed_title, |
126 | - COALESCE(ttrss_feed_categories.title, '" . __('Uncategorized') . "') AS cat_title, |
|
126 | + COALESCE(ttrss_feed_categories.title, '" . __('Uncategorized')."') AS cat_title, |
|
127 | 127 | date_updated, |
128 | 128 | ttrss_user_entries.ref_id, |
129 | 129 | link, |
130 | 130 | score, |
131 | 131 | content, |
132 | - " . SUBSTRING_FOR_DATE . "(last_updated,1,19) AS last_updated |
|
132 | + " . SUBSTRING_FOR_DATE."(last_updated,1,19) AS last_updated |
|
133 | 133 | FROM |
134 | 134 | ttrss_user_entries,ttrss_entries,ttrss_feeds |
135 | 135 | LEFT JOIN |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | $user_id); |
166 | 166 | |
167 | 167 | if (get_pref('ENABLE_FEED_CATS', $user_id)) { |
168 | - $line['feed_title'] = $line['cat_title'] . " / " . $line['feed_title']; |
|
168 | + $line['feed_title'] = $line['cat_title']." / ".$line['feed_title']; |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | $article_labels = Article::get_article_labels($line["ref_id"], $user_id); |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | $sth->execute([":uid" => $owner_uid, ":cat" => $feed_id]); |
136 | 136 | |
137 | 137 | while ($line = $sth->fetch()) { |
138 | - CCache::update((int)$line["id"], $owner_uid, false, false); |
|
138 | + CCache::update((int) $line["id"], $owner_uid, false, false); |
|
139 | 139 | } |
140 | 140 | } |
141 | 141 | |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | $sth->execute([$owner_uid, $feed_id]); |
198 | 198 | |
199 | 199 | if ($row = $sth->fetch()) { |
200 | - CCache::update((int)$row["cat_id"], $owner_uid, true, true, true); |
|
200 | + CCache::update((int) $row["cat_id"], $owner_uid, true, true, true); |
|
201 | 201 | } |
202 | 202 | } |
203 | 203 | } |
@@ -175,7 +175,7 @@ |
||
175 | 175 | |
176 | 176 | // we don't support numeric tags |
177 | 177 | if (is_numeric($cat)) |
178 | - $cat = 't:' . $cat; |
|
178 | + $cat = 't:'.$cat; |
|
179 | 179 | |
180 | 180 | $cat = preg_replace('/[,\'\"]/', "", $cat); |
181 | 181 |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | |
8 | 8 | require_once "lib/MiniTemplator.class.php"; |
9 | 9 | |
10 | - $note_style = "background-color : #fff7d5; |
|
10 | + $note_style = "background-color : #fff7d5; |
|
11 | 11 | border-width : 1px; ". |
12 | 12 | "padding : 5px; border-style : dashed; border-color : #e7d796;". |
13 | 13 | "margin-bottom : 1em; color : #9a8c59;"; |
@@ -73,8 +73,8 @@ discard block |
||
73 | 73 | $feed_site_url = $qfh_ret[2]; |
74 | 74 | /* $last_error = $qfh_ret[3]; */ |
75 | 75 | |
76 | - $feed_self_url = get_self_url_prefix() . |
|
77 | - "/public.php?op=rss&id=$feed&key=" . |
|
76 | + $feed_self_url = get_self_url_prefix(). |
|
77 | + "/public.php?op=rss&id=$feed&key=". |
|
78 | 78 | Feeds::get_feed_access_key($feed, false, $owner_uid); |
79 | 79 | |
80 | 80 | if (!$feed_site_url) $feed_site_url = get_self_url_prefix(); |
@@ -102,8 +102,7 @@ discard block |
||
102 | 102 | } |
103 | 103 | |
104 | 104 | $tpl->setVariable('ARTICLE_ID', |
105 | - htmlspecialchars($orig_guid ? $line['link'] : |
|
106 | - $this->make_article_tag_uri($line['id'], $line['date_entered'])), true); |
|
105 | + htmlspecialchars($orig_guid ? $line['link'] : $this->make_article_tag_uri($line['id'], $line['date_entered'])), true); |
|
107 | 106 | $tpl->setVariable('ARTICLE_LINK', htmlspecialchars($line['link']), true); |
108 | 107 | $tpl->setVariable('ARTICLE_TITLE', htmlspecialchars($line['title']), true); |
109 | 108 | $tpl->setVariable('ARTICLE_EXCERPT', $line["content_preview"], true); |
@@ -112,7 +111,7 @@ discard block |
||
112 | 111 | $feed_site_url, false, $line["id"]); |
113 | 112 | |
114 | 113 | if ($line['note']) { |
115 | - $content = "<div style=\"$note_style\">Article note: " . $line['note'] . "</div>" . |
|
114 | + $content = "<div style=\"$note_style\">Article note: ".$line['note']."</div>". |
|
116 | 115 | $content; |
117 | 116 | $tpl->setVariable('ARTICLE_NOTE', htmlspecialchars($line['note']), true); |
118 | 117 | } |
@@ -201,7 +200,7 @@ discard block |
||
201 | 200 | $article = array(); |
202 | 201 | |
203 | 202 | $article['id'] = $line['link']; |
204 | - $article['link'] = $line['link']; |
|
203 | + $article['link'] = $line['link']; |
|
205 | 204 | $article['title'] = $line['title']; |
206 | 205 | $article['excerpt'] = $line["content_preview"]; |
207 | 206 | $article['content'] = sanitize($line["content"], false, $owner_uid, $feed_site_url, false, $line["id"]); |
@@ -277,13 +276,13 @@ discard block |
||
277 | 276 | WHERE ttrss_users.id = ttrss_settings_profiles.owner_uid AND login = ? ORDER BY title"); |
278 | 277 | $sth->execute([$login]); |
279 | 278 | |
280 | - $rv = [ [ "value" => 0, "label" => __("Default profile") ] ]; |
|
279 | + $rv = [["value" => 0, "label" => __("Default profile")]]; |
|
281 | 280 | |
282 | 281 | while ($line = $sth->fetch()) { |
283 | 282 | $id = $line["id"]; |
284 | 283 | $title = $line["title"]; |
285 | 284 | |
286 | - array_push($rv, [ "label" => $title, "value" => $id ]); |
|
285 | + array_push($rv, ["label" => $title, "value" => $id]); |
|
287 | 286 | } |
288 | 287 | } |
289 | 288 | |
@@ -384,7 +383,7 @@ discard block |
||
384 | 383 | list ($og_image, $og_stream) = Article::get_article_image($enclosures, $line['content'], $line["site_url"]); |
385 | 384 | |
386 | 385 | if ($og_image) { |
387 | - $rv .= "<meta property='og:image' content=\"" . htmlspecialchars($og_image) . "\"/>"; |
|
386 | + $rv .= "<meta property='og:image' content=\"".htmlspecialchars($og_image)."\"/>"; |
|
388 | 387 | } |
389 | 388 | |
390 | 389 | $rv .= "<body class='flat ttrss_utility ttrss_zoom'>"; |
@@ -393,9 +392,9 @@ discard block |
||
393 | 392 | if ($line["link"]) { |
394 | 393 | $rv .= "<h1><a target='_blank' rel='noopener noreferrer' |
395 | 394 | title=\"".htmlspecialchars($line['title'])."\" |
396 | - href=\"" .htmlspecialchars($line["link"]) . "\">" . $line["title"] . "</a></h1>"; |
|
395 | + href=\"" .htmlspecialchars($line["link"])."\">".$line["title"]."</a></h1>"; |
|
397 | 396 | } else { |
398 | - $rv .= "<h1>" . $line["title"] . "</h1>"; |
|
397 | + $rv .= "<h1>".$line["title"]."</h1>"; |
|
399 | 398 | } |
400 | 399 | |
401 | 400 | $rv .= "<div class='content post'>"; |
@@ -448,8 +447,8 @@ discard block |
||
448 | 447 | $feed = clean($_REQUEST["id"]); |
449 | 448 | $key = clean($_REQUEST["key"]); |
450 | 449 | $is_cat = clean($_REQUEST["is_cat"]); |
451 | - $limit = (int)clean($_REQUEST["limit"]); |
|
452 | - $offset = (int)clean($_REQUEST["offset"]); |
|
450 | + $limit = (int) clean($_REQUEST["limit"]); |
|
451 | + $offset = (int) clean($_REQUEST["offset"]); |
|
453 | 452 | |
454 | 453 | $search = clean($_REQUEST["q"]); |
455 | 454 | $view_mode = clean($_REQUEST["view-mode"]); |
@@ -692,9 +691,9 @@ discard block |
||
692 | 691 | $return = clean($_REQUEST['return']); |
693 | 692 | |
694 | 693 | if ($_REQUEST['return'] && mb_strpos($return, SELF_URL_PATH) === 0) { |
695 | - header("Location: " . clean($_REQUEST['return'])); |
|
694 | + header("Location: ".clean($_REQUEST['return'])); |
|
696 | 695 | } else { |
697 | - header("Location: " . get_self_url_prefix()); |
|
696 | + header("Location: ".get_self_url_prefix()); |
|
698 | 697 | } |
699 | 698 | } |
700 | 699 | } |
@@ -786,7 +785,7 @@ discard block |
||
786 | 785 | print "<input type='hidden' name='op' value='subscribe'>"; |
787 | 786 | |
788 | 787 | print "<fieldset>"; |
789 | - print "<label style='display : inline'>" . __("Multiple feed URLs found:") . "</label>"; |
|
788 | + print "<label style='display : inline'>".__("Multiple feed URLs found:")."</label>"; |
|
790 | 789 | print "<select name='feed_url' dojoType='dijit.form.Select'>"; |
791 | 790 | |
792 | 791 | foreach ($feed_urls as $url => $name) { |
@@ -805,9 +804,9 @@ discard block |
||
805 | 804 | print "</form>"; |
806 | 805 | } |
807 | 806 | |
808 | - $tp_uri = get_self_url_prefix() . "/prefs.php"; |
|
807 | + $tp_uri = get_self_url_prefix()."/prefs.php"; |
|
809 | 808 | |
810 | - if ($rc['code'] <= 2){ |
|
809 | + if ($rc['code'] <= 2) { |
|
811 | 810 | $sth = $this->pdo->prepare("SELECT id FROM ttrss_feeds WHERE |
812 | 811 | feed_url = ? AND owner_uid = ?"); |
813 | 812 | $sth->execute([$feed_url, $_SESSION['uid']]); |
@@ -895,7 +894,7 @@ discard block |
||
895 | 894 | list($timestamp, $resetpass_token) = explode(":", $resetpass_token_full); |
896 | 895 | |
897 | 896 | if ($timestamp && $resetpass_token && |
898 | - $timestamp >= time() - 15*60*60 && |
|
897 | + $timestamp >= time() - 15 * 60 * 60 && |
|
899 | 898 | $resetpass_token == $hash) { |
900 | 899 | |
901 | 900 | $sth = $this->pdo->prepare("UPDATE ttrss_users SET resetpass_token = NULL |
@@ -935,8 +934,8 @@ discard block |
||
935 | 934 | <input dojoType='dijit.form.TextBox' type='email' name='email' value='' required> |
936 | 935 | </fieldset>"; |
937 | 936 | |
938 | - $_SESSION["pwdreset:testvalue1"] = rand(1,10); |
|
939 | - $_SESSION["pwdreset:testvalue2"] = rand(1,10); |
|
937 | + $_SESSION["pwdreset:testvalue1"] = rand(1, 10); |
|
938 | + $_SESSION["pwdreset:testvalue2"] = rand(1, 10); |
|
940 | 939 | |
941 | 940 | print "<fieldset> |
942 | 941 | <label>".T_sprintf("How much is %d + %d:", $_SESSION["pwdreset:testvalue1"], $_SESSION["pwdreset:testvalue2"])."</label> |
@@ -981,8 +980,8 @@ discard block |
||
981 | 980 | |
982 | 981 | if ($id) { |
983 | 982 | $resetpass_token = sha1(get_random_bytes(128)); |
984 | - $resetpass_link = get_self_url_prefix() . "/public.php?op=forgotpass&hash=" . $resetpass_token . |
|
985 | - "&login=" . urlencode($login); |
|
983 | + $resetpass_link = get_self_url_prefix()."/public.php?op=forgotpass&hash=".$resetpass_token. |
|
984 | + "&login=".urlencode($login); |
|
986 | 985 | |
987 | 986 | require_once "lib/MiniTemplator.class.php"; |
988 | 987 | |
@@ -1009,7 +1008,7 @@ discard block |
||
1009 | 1008 | |
1010 | 1009 | if (!$rc) print_error($mailer->error()); |
1011 | 1010 | |
1012 | - $resetpass_token_full = time() . ":" . $resetpass_token; |
|
1011 | + $resetpass_token_full = time().":".$resetpass_token; |
|
1013 | 1012 | |
1014 | 1013 | $sth = $this->pdo->prepare("UPDATE ttrss_users |
1015 | 1014 | SET resetpass_token = ? |
@@ -1099,12 +1098,12 @@ discard block |
||
1099 | 1098 | if ($op == "performupdate") { |
1100 | 1099 | if ($updater->isUpdateRequired()) { |
1101 | 1100 | |
1102 | - print "<h2>" . T_sprintf("Performing updates to version %d", SCHEMA_VERSION) . "</h2>"; |
|
1101 | + print "<h2>".T_sprintf("Performing updates to version %d", SCHEMA_VERSION)."</h2>"; |
|
1103 | 1102 | |
1104 | 1103 | for ($i = $updater->getSchemaVersion() + 1; $i <= SCHEMA_VERSION; $i++) { |
1105 | 1104 | print "<ul>"; |
1106 | 1105 | |
1107 | - print "<li class='text-info'>" . T_sprintf("Updating to version %d", $i) . "</li>"; |
|
1106 | + print "<li class='text-info'>".T_sprintf("Updating to version %d", $i)."</li>"; |
|
1108 | 1107 | |
1109 | 1108 | print "<li>"; |
1110 | 1109 | $result = $updater->performUpdateTo($i, true); |
@@ -1123,7 +1122,7 @@ discard block |
||
1123 | 1122 | |
1124 | 1123 | return; |
1125 | 1124 | } else { |
1126 | - print "<li class='text-success'>" . __("Completed.") . "</li>"; |
|
1125 | + print "<li class='text-success'>".__("Completed.")."</li>"; |
|
1127 | 1126 | print "</ul>"; |
1128 | 1127 | } |
1129 | 1128 | } |
@@ -1191,7 +1190,7 @@ discard block |
||
1191 | 1190 | |
1192 | 1191 | $timestamp = date("Y-m-d", strtotime($timestamp)); |
1193 | 1192 | |
1194 | - return "tag:" . parse_url(get_self_url_prefix(), PHP_URL_HOST) . ",$timestamp:/$id"; |
|
1193 | + return "tag:".parse_url(get_self_url_prefix(), PHP_URL_HOST).",$timestamp:/$id"; |
|
1195 | 1194 | } |
1196 | 1195 | |
1197 | 1196 | // this should be used very carefully because this endpoint is exposed to unauthenticated users |
@@ -26,7 +26,7 @@ discard block |
||
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 |
||
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 |
||
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; |
@@ -70,7 +70,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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; |
@@ -52,9 +52,9 @@ |
||
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(); |
@@ -11,7 +11,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | } |