@@ -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; |
@@ -93,7 +93,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 = " — " . truncate_string($entry["title"], 30); |
|
| 530 | + $title = " — ".truncate_string($entry["title"], 30); |
|
| 531 | 531 | else |
| 532 | 532 | $title = ""; |
| 533 | 533 | |
@@ -537,7 +537,7 @@ discard block |
||
| 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 |
||
| 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 .= ", …"; |
@@ -803,7 +803,7 @@ discard block |
||
| 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 |
||
| 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") { |
@@ -2,8 +2,8 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 243 | 243 | if (!get_pref('SHOW_CONTENT_PREVIEW')) { |
| 244 | 244 | $line["content_preview"] = ""; |
| 245 | 245 | } else { |
| 246 | - $line["content_preview"] = "— " . truncate_string(strip_tags($line["content"]), 250); |
|
| 246 | + $line["content_preview"] = "— ".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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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)); |
@@ -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 | } |