concrete/src/Utility/Service/Text.php
public function slugSafeString($handle, $maxlength = 128)
    {
        $handle = preg_replace('/[^\\p{L}\\p{Nd}\-_]+/u', ' ', $handle); // remove unneeded chars
        $handle = preg_replace('/[-\s]+/', '-', $handle); // convert spaces to hyphens
        return trim(Utf8::substr($handle, 0, $maxlength), '-'); // trim to first $max_length chars
    }
public function slugSafeString($handle, $maxlength = 128)
    {
        $handle = preg_replace('/[^\\p{L}\\p{Nd}\-_]+/u', ' ', $handle); // remove unneeded chars
        $handle = preg_replace('/[-\s]+/', '-', $handle); // convert spaces to hyphens
        return trim(Utf8::substr($handle, 0, $maxlength), '-'); // trim to first $max_length chars
    }
public function slugSafeString ( $ handle , $ maxlength = 128 ) { $ handle = preg_replace ( '/[^\\p{L}\\p{Nd}\-_]+/u' , ' ' , $ handle ) ; // remove unneeded chars $ handle = preg_replace ( '/[-\s]+/' , '-' , $ handle ) ; // convert spaces to hyphens return trim ( Utf8 :: substr ( $ handle , 0 , $ maxlength ) , '-' ) ; // trim to first $max_length chars }
Remove unsafe characters for URL slug.

@param string $handle
@param int    $maxlength = Max number of characters of the return value

@return string $handle
Remove unsafe characters for URL slug .