mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 07:25:54 +00:00
fix blank character after opening bracket in function calls
This commit is contained in:
@@ -8,9 +8,9 @@ class Article extends Handler_Protected {
|
||||
}
|
||||
|
||||
function redirect() {
|
||||
$id = db_escape_string( $_REQUEST['id']);
|
||||
$id = db_escape_string($_REQUEST['id']);
|
||||
|
||||
$result = db_query( "SELECT link FROM ttrss_entries, ttrss_user_entries
|
||||
$result = db_query("SELECT link FROM ttrss_entries, ttrss_user_entries
|
||||
WHERE id = '$id' AND id = ref_id AND owner_uid = '".$_SESSION['uid']."'
|
||||
LIMIT 1");
|
||||
|
||||
@@ -27,10 +27,10 @@ class Article extends Handler_Protected {
|
||||
}
|
||||
|
||||
function view() {
|
||||
$id = db_escape_string( $_REQUEST["id"]);
|
||||
$cids = explode(",", db_escape_string( $_REQUEST["cids"]));
|
||||
$mode = db_escape_string( $_REQUEST["mode"]);
|
||||
$omode = db_escape_string( $_REQUEST["omode"]);
|
||||
$id = db_escape_string($_REQUEST["id"]);
|
||||
$cids = explode(",", db_escape_string($_REQUEST["cids"]));
|
||||
$mode = db_escape_string($_REQUEST["mode"]);
|
||||
$omode = db_escape_string($_REQUEST["omode"]);
|
||||
|
||||
// in prefetch mode we only output requested cids, main article
|
||||
// just gets marked as read (it already exists in client cache)
|
||||
@@ -38,26 +38,26 @@ class Article extends Handler_Protected {
|
||||
$articles = array();
|
||||
|
||||
if ($mode == "") {
|
||||
array_push($articles, format_article( $id, false));
|
||||
array_push($articles, format_article($id, false));
|
||||
} else if ($mode == "zoom") {
|
||||
array_push($articles, format_article( $id, true, true));
|
||||
array_push($articles, format_article($id, true, true));
|
||||
} else if ($mode == "raw") {
|
||||
if ($_REQUEST['html']) {
|
||||
header("Content-Type: text/html");
|
||||
print '<link rel="stylesheet" type="text/css" href="tt-rss.css"/>';
|
||||
}
|
||||
|
||||
$article = format_article( $id, false);
|
||||
$article = format_article($id, false);
|
||||
print $article['content'];
|
||||
return;
|
||||
}
|
||||
|
||||
$this->catchupArticleById( $id, 0);
|
||||
$this->catchupArticleById($id, 0);
|
||||
|
||||
if (!$_SESSION["bw_limit"]) {
|
||||
foreach ($cids as $cid) {
|
||||
if ($cid) {
|
||||
array_push($articles, format_article( $cid, false, false));
|
||||
array_push($articles, format_article($cid, false, false));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -65,27 +65,27 @@ class Article extends Handler_Protected {
|
||||
print json_encode($articles);
|
||||
}
|
||||
|
||||
private function catchupArticleById( $id, $cmode) {
|
||||
private function catchupArticleById($id, $cmode) {
|
||||
|
||||
if ($cmode == 0) {
|
||||
db_query( "UPDATE ttrss_user_entries SET
|
||||
db_query("UPDATE ttrss_user_entries SET
|
||||
unread = false,last_read = NOW()
|
||||
WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]);
|
||||
} else if ($cmode == 1) {
|
||||
db_query( "UPDATE ttrss_user_entries SET
|
||||
db_query("UPDATE ttrss_user_entries SET
|
||||
unread = true
|
||||
WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]);
|
||||
} else {
|
||||
db_query( "UPDATE ttrss_user_entries SET
|
||||
db_query("UPDATE ttrss_user_entries SET
|
||||
unread = NOT unread,last_read = NOW()
|
||||
WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]);
|
||||
}
|
||||
|
||||
$feed_id = getArticleFeed( $id);
|
||||
ccache_update( $feed_id, $_SESSION["uid"]);
|
||||
$feed_id = getArticleFeed($id);
|
||||
ccache_update($feed_id, $_SESSION["uid"]);
|
||||
}
|
||||
|
||||
static function create_published_article( $title, $url, $content, $labels_str,
|
||||
static function create_published_article($title, $url, $content, $labels_str,
|
||||
$owner_uid) {
|
||||
|
||||
$guid = 'SHA1:' . sha1("ttshared:" . $url . $owner_uid); // include owner_uid to prevent global GUID clash
|
||||
@@ -104,30 +104,30 @@ class Article extends Handler_Protected {
|
||||
|
||||
if (filter_var($url, FILTER_VALIDATE_URL) === FALSE) return false;
|
||||
|
||||
db_query( "BEGIN");
|
||||
db_query("BEGIN");
|
||||
|
||||
// only check for our user data here, others might have shared this with different content etc
|
||||
$result = db_query( "SELECT id FROM ttrss_entries, ttrss_user_entries WHERE
|
||||
$result = db_query("SELECT id FROM ttrss_entries, ttrss_user_entries WHERE
|
||||
link = '$url' AND ref_id = id AND owner_uid = '$owner_uid' LIMIT 1");
|
||||
|
||||
if (db_num_rows($result) != 0) {
|
||||
$ref_id = db_fetch_result($result, 0, "id");
|
||||
|
||||
$result = db_query( "SELECT int_id FROM ttrss_user_entries WHERE
|
||||
$result = db_query("SELECT int_id FROM ttrss_user_entries WHERE
|
||||
ref_id = '$ref_id' AND owner_uid = '$owner_uid' LIMIT 1");
|
||||
|
||||
if (db_num_rows($result) != 0) {
|
||||
$int_id = db_fetch_result($result, 0, "int_id");
|
||||
|
||||
db_query( "UPDATE ttrss_entries SET
|
||||
db_query("UPDATE ttrss_entries SET
|
||||
content = '$content', content_hash = '$content_hash' WHERE id = '$ref_id'");
|
||||
|
||||
db_query( "UPDATE ttrss_user_entries SET published = true,
|
||||
db_query("UPDATE ttrss_user_entries SET published = true,
|
||||
last_published = NOW() WHERE
|
||||
int_id = '$int_id' AND owner_uid = '$owner_uid'");
|
||||
} else {
|
||||
|
||||
db_query( "INSERT INTO ttrss_user_entries
|
||||
db_query("INSERT INTO ttrss_user_entries
|
||||
(ref_id, uuid, feed_id, orig_feed_id, owner_uid, published, tag_cache, label_cache,
|
||||
last_read, note, unread, last_published)
|
||||
VALUES
|
||||
@@ -136,24 +136,24 @@ class Article extends Handler_Protected {
|
||||
|
||||
if (count($labels) != 0) {
|
||||
foreach ($labels as $label) {
|
||||
label_add_article( $ref_id, trim($label), $owner_uid);
|
||||
label_add_article($ref_id, trim($label), $owner_uid);
|
||||
}
|
||||
}
|
||||
|
||||
$rc = true;
|
||||
|
||||
} else {
|
||||
$result = db_query( "INSERT INTO ttrss_entries
|
||||
$result = db_query("INSERT INTO ttrss_entries
|
||||
(title, guid, link, updated, content, content_hash, date_entered, date_updated)
|
||||
VALUES
|
||||
('$title', '$guid', '$url', NOW(), '$content', '$content_hash', NOW(), NOW())");
|
||||
|
||||
$result = db_query( "SELECT id FROM ttrss_entries WHERE guid = '$guid'");
|
||||
$result = db_query("SELECT id FROM ttrss_entries WHERE guid = '$guid'");
|
||||
|
||||
if (db_num_rows($result) != 0) {
|
||||
$ref_id = db_fetch_result($result, 0, "id");
|
||||
|
||||
db_query( "INSERT INTO ttrss_user_entries
|
||||
db_query("INSERT INTO ttrss_user_entries
|
||||
(ref_id, uuid, feed_id, orig_feed_id, owner_uid, published, tag_cache, label_cache,
|
||||
last_read, note, unread, last_published)
|
||||
VALUES
|
||||
@@ -161,7 +161,7 @@ class Article extends Handler_Protected {
|
||||
|
||||
if (count($labels) != 0) {
|
||||
foreach ($labels as $label) {
|
||||
label_add_article( $ref_id, trim($label), $owner_uid);
|
||||
label_add_article($ref_id, trim($label), $owner_uid);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ class Article extends Handler_Protected {
|
||||
}
|
||||
}
|
||||
|
||||
db_query( "COMMIT");
|
||||
db_query("COMMIT");
|
||||
|
||||
return $rc;
|
||||
}
|
||||
@@ -178,9 +178,9 @@ class Article extends Handler_Protected {
|
||||
|
||||
print __("Tags for this article (separated by commas):")."<br>";
|
||||
|
||||
$param = db_escape_string( $_REQUEST['param']);
|
||||
$param = db_escape_string($_REQUEST['param']);
|
||||
|
||||
$tags = get_article_tags( db_escape_string( $param));
|
||||
$tags = get_article_tags(db_escape_string($param));
|
||||
|
||||
$tags_str = join(", ", $tags);
|
||||
|
||||
@@ -209,10 +209,10 @@ class Article extends Handler_Protected {
|
||||
}
|
||||
|
||||
function setScore() {
|
||||
$ids = db_escape_string( $_REQUEST['id']);
|
||||
$score = (int)db_escape_string( $_REQUEST['score']);
|
||||
$ids = db_escape_string($_REQUEST['id']);
|
||||
$score = (int)db_escape_string($_REQUEST['score']);
|
||||
|
||||
db_query( "UPDATE ttrss_user_entries SET
|
||||
db_query("UPDATE ttrss_user_entries SET
|
||||
score = '$score' WHERE ref_id IN ($ids) AND owner_uid = " . $_SESSION["uid"]);
|
||||
|
||||
print json_encode(array("id" => $id,
|
||||
@@ -222,14 +222,14 @@ class Article extends Handler_Protected {
|
||||
|
||||
function setArticleTags() {
|
||||
|
||||
$id = db_escape_string( $_REQUEST["id"]);
|
||||
$id = db_escape_string($_REQUEST["id"]);
|
||||
|
||||
$tags_str = db_escape_string( $_REQUEST["tags_str"]);
|
||||
$tags_str = db_escape_string($_REQUEST["tags_str"]);
|
||||
$tags = array_unique(trim_array(explode(",", $tags_str)));
|
||||
|
||||
db_query( "BEGIN");
|
||||
db_query("BEGIN");
|
||||
|
||||
$result = db_query( "SELECT int_id FROM ttrss_user_entries WHERE
|
||||
$result = db_query("SELECT int_id FROM ttrss_user_entries WHERE
|
||||
ref_id = '$id' AND owner_uid = '".$_SESSION["uid"]."' LIMIT 1");
|
||||
|
||||
if (db_num_rows($result) == 1) {
|
||||
@@ -238,7 +238,7 @@ class Article extends Handler_Protected {
|
||||
|
||||
$int_id = db_fetch_result($result, 0, "int_id");
|
||||
|
||||
db_query( "DELETE FROM ttrss_tags WHERE
|
||||
db_query("DELETE FROM ttrss_tags WHERE
|
||||
post_int_id = $int_id AND owner_uid = '".$_SESSION["uid"]."'");
|
||||
|
||||
foreach ($tags as $tag) {
|
||||
@@ -255,7 +255,7 @@ class Article extends Handler_Protected {
|
||||
// print "<!-- $id : $int_id : $tag -->";
|
||||
|
||||
if ($tag != '') {
|
||||
db_query( "INSERT INTO ttrss_tags
|
||||
db_query("INSERT INTO ttrss_tags
|
||||
(post_int_id, owner_uid, tag_name) VALUES ('$int_id', '".$_SESSION["uid"]."', '$tag')");
|
||||
}
|
||||
|
||||
@@ -267,14 +267,14 @@ class Article extends Handler_Protected {
|
||||
sort($tags_to_cache);
|
||||
$tags_str = join(",", $tags_to_cache);
|
||||
|
||||
db_query( "UPDATE ttrss_user_entries
|
||||
db_query("UPDATE ttrss_user_entries
|
||||
SET tag_cache = '$tags_str' WHERE ref_id = '$id'
|
||||
AND owner_uid = " . $_SESSION["uid"]);
|
||||
}
|
||||
|
||||
db_query( "COMMIT");
|
||||
db_query("COMMIT");
|
||||
|
||||
$tags = get_article_tags( $id);
|
||||
$tags = get_article_tags($id);
|
||||
$tags_str = format_tags_string($tags, $id);
|
||||
$tags_str_full = join(", ", $tags);
|
||||
|
||||
@@ -286,9 +286,9 @@ class Article extends Handler_Protected {
|
||||
|
||||
|
||||
function completeTags() {
|
||||
$search = db_escape_string( $_REQUEST["search"]);
|
||||
$search = db_escape_string($_REQUEST["search"]);
|
||||
|
||||
$result = db_query( "SELECT DISTINCT tag_name FROM ttrss_tags
|
||||
$result = db_query("SELECT DISTINCT tag_name FROM ttrss_tags
|
||||
WHERE owner_uid = '".$_SESSION["uid"]."' AND
|
||||
tag_name LIKE '$search%' ORDER BY tag_name
|
||||
LIMIT 10");
|
||||
@@ -311,10 +311,10 @@ class Article extends Handler_Protected {
|
||||
private function labelops($assign) {
|
||||
$reply = array();
|
||||
|
||||
$ids = explode(",", db_escape_string( $_REQUEST["ids"]));
|
||||
$label_id = db_escape_string( $_REQUEST["lid"]);
|
||||
$ids = explode(",", db_escape_string($_REQUEST["ids"]));
|
||||
$label_id = db_escape_string($_REQUEST["lid"]);
|
||||
|
||||
$label = db_escape_string( label_find_caption( $label_id,
|
||||
$label = db_escape_string(label_find_caption($label_id,
|
||||
$_SESSION["uid"]));
|
||||
|
||||
$reply["info-for-headlines"] = array();
|
||||
@@ -324,11 +324,11 @@ class Article extends Handler_Protected {
|
||||
foreach ($ids as $id) {
|
||||
|
||||
if ($assign)
|
||||
label_add_article( $id, $label, $_SESSION["uid"]);
|
||||
label_add_article($id, $label, $_SESSION["uid"]);
|
||||
else
|
||||
label_remove_article( $id, $label, $_SESSION["uid"]);
|
||||
label_remove_article($id, $label, $_SESSION["uid"]);
|
||||
|
||||
$labels = get_article_labels( $id, $_SESSION["uid"]);
|
||||
$labels = get_article_labels($id, $_SESSION["uid"]);
|
||||
|
||||
array_push($reply["info-for-headlines"],
|
||||
array("id" => $id, "labels" => format_article_labels($labels, $id)));
|
||||
|
||||
Reference in New Issue
Block a user