diff options
Diffstat (limited to 'Zotlabs/Lib/Libzotdir.php')
-rw-r--r-- | Zotlabs/Lib/Libzotdir.php | 18 |
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']) ); } } |