@@ -23,7 +23,7 @@ |
||
| 23 | 23 | |
| 24 | 24 | foreach ($server_params as $n => $p) { |
| 25 | 25 | if (isset($_SERVER[$p])) |
| 26 | - $context .= "\n$n: " . $_SERVER[$p]; |
|
| 26 | + $context .= "\n$n: ".$_SERVER[$p]; |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | // passed error message may contain invalid unicode characters, failing to insert an error here |
@@ -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; |
@@ -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 | } |
@@ -1,5 +1,5 @@ discard block |
||
| 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 |
||
| 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]); |