$entry_tags = array_unique($additional_tags);
- for ($i = 0; $i < count($entry_tags); $i++)
+ for ($i = 0; $i < count($entry_tags); $i++) {
$entry_tags[$i] = mb_strtolower($entry_tags[$i], 'utf-8');
+ // we don't support numeric tags, let's prefix them
+ if (is_numeric($entry_tags[$i])) $entry_tags[$i] = 't:' . $entry_tags[$i];
+ }
+
_debug("tags found: " . join(",", $entry_tags), $debug_enabled);
_debug("done collecting data.", $debug_enabled);
_debug("plugin data: $entry_plugin_data", $debug_enabled);
// Workaround: 4-byte unicode requires utf8mb4 in MySQL. See https://tt-rss.org/forum/viewtopic.php?f=1&t=3377&p=20077#p20077
- if (DB_TYPE == "mysql") {
+ if (DB_TYPE == "mysql" && MYSQL_CHARSET != "UTF8MB4") {
foreach ($article as $k => $v) {
// i guess we'll have to take the risk of 4byte unicode labels & tags here
if (is_string($article[$k])) {
_debug("resulting RID: $entry_ref_id, IID: $entry_int_id", $debug_enabled);
- if (DB_TYPE == "pgsql") {
- $tsvector_combined = mb_substr($entry_title . ' ' .
- preg_replace('/[<\?\:]/', ' ', strip_tags($entry_content)),
- 0, 1000000);
-
- $tsvector_qpart = "tsvector_combined = to_tsvector(".$pdo->quote($feed_language).", ".$pdo->quote($tsvector_combined)."),";
-
- } else {
+ if (DB_TYPE == "pgsql")
+ $tsvector_qpart = "tsvector_combined = to_tsvector(:ts_lang, :ts_content),";
+ else
$tsvector_qpart = "";
- }
-
- //_debug($tsvector_qpart);
$sth = $pdo->prepare("UPDATE ttrss_entries
SET title = :title,
content = :content,
content_hash = :content_hash,
updated = :updated,
+ date_updated = NOW(),
num_comments = :num_comments,
plugin_data = :plugin_data,
author = :author,
lang = :lang
WHERE id = :id");
- $sth->execute([":title" => $entry_title,
+ $params = [":title" => $entry_title,
":content" => "$entry_content",
":content_hash" => $entry_current_hash,
":updated" => $entry_timestamp_fmt,
":plugin_data" => $entry_plugin_data,
":author" => "$entry_author",
":lang" => $entry_language,
- ":id" => $ref_id]);
+ ":id" => $ref_id];
+
+ if (DB_TYPE == "pgsql") {
+ $params[":ts_lang"] = $feed_language;
+ $params[":ts_content"] = mb_substr(strip_tags($entry_title . " " . $entry_content), 0, 900000);
+ }
+
+ $sth->execute($params);
// update aux data
$sth = $pdo->prepare("UPDATE ttrss_user_entries
$e->type, $e->length, $e->title, $e->width, $e->height);
// Yet another episode of "mysql utf8_general_ci is gimped"
- if (DB_TYPE == "mysql") {
+ if (DB_TYPE == "mysql" && MYSQL_CHARSET != "UTF8MB4") {
for ($i = 0; $i < count($e_item); $i++) {
if (is_string($e_item[$i])) {
$e_item[$i] = RSSUtils::strip_utf8mb4($e_item[$i]);