summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2015-07-06 15:32:26 +0300
committerAndrew Dolgov <[email protected]>2015-07-06 15:32:26 +0300
commit35c373549453d962907c14a81059a1de0dfc5e7a (patch)
tree2f0a2e35a4399d93407e16094b7fe53a67bd9fef /include
parent6affdc59a31e41c9142c6e2ed8191564a4cbd79b (diff)
fix article tags/labels not assigning properly on mysql because of the 4byte unicode workaround
Diffstat (limited to 'include')
-rw-r--r--include/functions2.php6
-rw-r--r--include/rssfuncs.php6
2 files changed, 8 insertions, 4 deletions
diff --git a/include/functions2.php b/include/functions2.php
index e212609db..1936d146d 100644
--- a/include/functions2.php
+++ b/include/functions2.php
@@ -1483,9 +1483,9 @@
$tag = preg_replace('/[\'\"\+\>\<]/', "", $tag);
-// $tag = str_replace('"', "", $tag);
-// $tag = str_replace("+", " ", $tag);
- $tag = str_replace("technorati tag: ", "", $tag);
+ if (DB_TYPE == "mysql") {
+ $tag = preg_replace('/[\x{10000}-\x{10FFFF}]/u', "\xEF\xBF\xBD", $tag);
+ }
return $tag;
}
diff --git a/include/rssfuncs.php b/include/rssfuncs.php
index 8797ee523..6eb4e6d98 100644
--- a/include/rssfuncs.php
+++ b/include/rssfuncs.php
@@ -761,7 +761,11 @@
// 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") {
foreach ($article as $k => $v) {
- $article[$k] = preg_replace('/[\x{10000}-\x{10FFFF}]/u', "\xEF\xBF\xBD", $v);
+
+ // i guess we'll have to take the risk of 4byte unicode labels & tags here
+ if (!is_array($article[$k])) {
+ $article[$k] = preg_replace('/[\x{10000}-\x{10FFFF}]/u', "\xEF\xBF\xBD", $v);
+ }
}
}