]> git.mxchange.org Git - friendica.git/blobdiff - include/text.php
Move perms2str to ACLFormatter::aclToString()
[friendica.git] / include / text.php
index 289802136c2670beab1306e39dac84cadaa48b92..13300c1e106bc36b6528a281da9aaf3feb0cc9b6 100644 (file)
@@ -5,47 +5,6 @@
 
 use Friendica\Content\Text\BBCode;
 use Friendica\Model\FileTag;
-use Friendica\Model\Group;
-use Friendica\Util\Strings;
-
-/**
- * Wrap ACL elements in angle brackets for storage
- * @param string $item
- */
-function sanitise_acl(&$item) {
-       if (intval($item)) {
-               $item = '<' . intval(Strings::escapeTags(trim($item))) . '>';
-       } elseif (in_array($item, [Group::FOLLOWERS, Group::MUTUALS])) {
-               $item = '<' . $item . '>';
-       } else {
-               unset($item);
-       }
-}
-
-
-/**
- * Convert an ACL array to a storable string
- *
- * Normally ACL permissions will be an array.
- * We'll also allow a comma-separated string.
- *
- * @param string|array $p
- * @return string
- */
-function perms2str($p) {
-       $ret = '';
-       if (is_array($p)) {
-               $tmp = $p;
-       } else {
-               $tmp = explode(',', $p);
-       }
-
-       if (is_array($tmp)) {
-               array_walk($tmp, 'sanitise_acl');
-               $ret = implode('', $tmp);
-       }
-       return $ret;
-}
 
 /**
  * Compare activity uri. Knows about activity namespace.