concrete/src/Entity/File/Version.php
public static function cleanTags($tagsStr)
    {
        $tagsArray = explode("\n", str_replace(["\r", ','], "\n", $tagsStr));
        $cleanTags = [];
        foreach ($tagsArray as $tag) {
            $tag = trim($tag);
            if ($tag !== '') {
                $cleanTags[] = $tag;
            }
        }
        //the leading and trailing line break char is for searching: fvTag like %\ntag\n%
        return isset($cleanTags[0]) ? "\n" . implode("\n", $cleanTags) . "\n" : '';
    }
public static function cleanTags($tagsStr)
    {
        $tagsArray = explode("\n", str_replace(["\r", ','], "\n", $tagsStr));
        $cleanTags = [];
        foreach ($tagsArray as $tag) {
            $tag = trim($tag);
            if ($tag !== '') {
                $cleanTags[] = $tag;
            }
        }
        //the leading and trailing line break char is for searching: fvTag like %\ntag\n%
        return isset($cleanTags[0]) ? "\n" . implode("\n", $cleanTags) . "\n" : '';
    }
public static function cleanTags ( $ tagsStr ) { $ tagsArray = explode ( "\n" , str_replace ( [ "\r" , ',' ] , "\n" , $ tagsStr ) ) ; $ cleanTags = [ ] ; foreach ( $ tagsArray as $ tag ) { $ tag = trim ( $ tag ) ; if ( $ tag !== '' ) { $ cleanTags [ ] = $ tag ; } } //the leading and trailing line break char is for searching: fvTag like %\ntag\n% return isset ( $ cleanTags [ 0 ] ) ? "\n" . implode ( "\n" , $ cleanTags ) . "\n" : '' ; }
Normalize the tags separator, remove empty tags.

@param string $tagsStr The list of tags, delimited by '\n', '\r' or ','

@return string
Normalize the tags separator remove empty tags .