diff options
author | zotlabs <mike@macgirvin.com> | 2018-03-12 20:54:55 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2018-03-12 20:54:55 -0700 |
commit | ab1d47b36f21e5881900d9d805f4f7876f1c472f (patch) | |
tree | 5d0de385738ebb2fc332b38ff4a59f0cf4f1ca68 /Zotlabs/Module/New_channel.php | |
parent | 34399b8b47d9a85eb3c4095392ab994792257d88 (diff) | |
download | volse-hubzilla-ab1d47b36f21e5881900d9d805f4f7876f1c472f.tar.gz volse-hubzilla-ab1d47b36f21e5881900d9d805f4f7876f1c472f.tar.bz2 volse-hubzilla-ab1d47b36f21e5881900d9d805f4f7876f1c472f.zip |
unicode/emoji usernames. Warning: experimental feature, unstable, untested, disabled by default, use at your own risk, may not federate to other platforms and protocols. May not clone correctly. Bug reports which neglect to include detailed roubleshooting information and patches/pull requests will be ignored.
Diffstat (limited to 'Zotlabs/Module/New_channel.php')
-rw-r--r-- | Zotlabs/Module/New_channel.php | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/Zotlabs/Module/New_channel.php b/Zotlabs/Module/New_channel.php index 548f28c4f..ea9f27447 100644 --- a/Zotlabs/Module/New_channel.php +++ b/Zotlabs/Module/New_channel.php @@ -16,8 +16,15 @@ class New_channel extends \Zotlabs\Web\Controller { require_once('library/urlify/URLify.php'); $result = array('error' => false, 'message' => ''); $n = trim($_REQUEST['name']); - - $x = strtolower(\URLify::transliterate($n)); + + $x = false; + + if(get_config('system','unicode_usernames')) { + $x = punify(mb_strtolower($n)); + } + + if((! $x) || strlen($x) > 64) + $x = strtolower(\URLify::transliterate($n)); $test = array(); @@ -43,7 +50,14 @@ class New_channel extends \Zotlabs\Web\Controller { $result = array('error' => false, 'message' => ''); $n = trim($_REQUEST['nick']); - $x = strtolower(\URLify::transliterate($n)); + $x = false; + + if(get_config('system','unicode_usernames')) { + $x = punify(mb_strtolower($n)); + } + + if((! $x) || strlen($x) > 64) + $x = strtolower(\URLify::transliterate($n)); $test = array(); |