diff options
Diffstat (limited to 'include')
-rwxr-xr-x | include/text.php | 6 | ||||
-rw-r--r-- | include/zot.php | 10 |
2 files changed, 16 insertions, 0 deletions
diff --git a/include/text.php b/include/text.php index e1f0a4e00..40df8bd89 100755 --- a/include/text.php +++ b/include/text.php @@ -1848,3 +1848,9 @@ function design_tools() { } +/* case insensitive in_array() */ + +function in_arrayi($needle, $haystack) { + return in_array(strtolower($needle), array_map('strtolower', $haystack)); +} + diff --git a/include/zot.php b/include/zot.php index c0b53bdc1..3929fa4c1 100644 --- a/include/zot.php +++ b/include/zot.php @@ -1404,6 +1404,16 @@ function import_directory_profile($hash,$profile) { $arr['xprof_keywords'] = implode(' ',$clean); + // Self censored, make it so + // These are not translated, so the German "erwachsenen" keyword will not censor the directory profile. Only the English form - "adult". + + if(in_arrayi('nsfw',$clean) || in_arrayi('adult',$clean)) { + q("update xchan set xchan_flags = (xchan_flags | %d) where xchan_hash = '%s' limit 1", + intval(XCHAN_FLAGS_CENSORED) + ); + } + + $r = q("select * from xprof where xprof_hash = '%s' limit 1", dbesc($hash) ); |