aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2023-05-04 09:28:05 +0000
committerMario <mario@mariovavti.com>2023-05-04 09:28:05 +0000
commitdfa43b48566ebdc758a46de0090cfcc9617471b1 (patch)
treee42fbcd6100e1cea35b6cee3614f5ff5940569e5 /Zotlabs/Lib
parenta24a1ca6d79cf48ae18352a9df9e94bc6c4c7431 (diff)
parent2d4b35fbc99062d52c6c32cacd158ceda661bb31 (diff)
downloadvolse-hubzilla-dfa43b48566ebdc758a46de0090cfcc9617471b1.tar.gz
volse-hubzilla-dfa43b48566ebdc758a46de0090cfcc9617471b1.tar.bz2
volse-hubzilla-dfa43b48566ebdc758a46de0090cfcc9617471b1.zip
Merge branch 'dev' of https://framagit.org/hubzilla/core into dev
Diffstat (limited to 'Zotlabs/Lib')
-rw-r--r--Zotlabs/Lib/Libzotdir.php18
1 files changed, 16 insertions, 2 deletions
diff --git a/Zotlabs/Lib/Libzotdir.php b/Zotlabs/Lib/Libzotdir.php
index e30ccc43c..58138850c 100644
--- a/Zotlabs/Lib/Libzotdir.php
+++ b/Zotlabs/Lib/Libzotdir.php
@@ -521,7 +521,12 @@ class Libzotdir {
$clean = array();
if (array_key_exists('keywords', $profile) and is_array($profile['keywords'])) {
self::import_directory_keywords($hash,$profile['keywords']);
+
foreach ($profile['keywords'] as $kw) {
+ if (in_array($kw, $clean)) {
+ continue;
+ }
+
$kw = trim(htmlspecialchars($kw,ENT_COMPAT, 'UTF-8', false));
$kw = trim($kw, ',');
$clean[] = $kw;
@@ -645,6 +650,10 @@ class Libzotdir {
dbesc($hash)
);
+ $xchan = q("select xchan_censored from xchan where xchan_hash = '%s'",
+ dbesc($hash)
+ );
+
if($r) {
foreach($r as $rr)
$existing[] = $rr['xtag_term'];
@@ -652,6 +661,10 @@ class Libzotdir {
$clean = array();
foreach($keywords as $kw) {
+ if (in_array($kw, $clean)) {
+ continue;
+ }
+
$kw = trim(htmlspecialchars($kw,ENT_COMPAT, 'UTF-8', false));
$kw = trim($kw, ',');
$clean[] = $kw;
@@ -666,9 +679,10 @@ class Libzotdir {
}
foreach($clean as $x) {
if(! in_array($x, $existing)) {
- $r = q("insert into xtag ( xtag_hash, xtag_term, xtag_flags) values ( '%s' ,'%s', 0 )",
+ $r = q("insert into xtag ( xtag_hash, xtag_term, xtag_flags) values ( '%s' ,'%s', %d )",
dbesc($hash),
- dbesc($x)
+ dbesc($x),
+ intval($xchan[0]['xchan_censored'])
);
}
}