PHPFusion\Rewrite\RewriteDriver::cleanURL PHP Метод

cleanURL() защищенный статический Метод

This function will clean the URL by removing any unwanted characters from it and only allowing alphanumeric and - in the URL. This function can be customized according to your needs.
protected static cleanURL ( string $string, $delimiter = "-" ) : string
$string string The URL String
Результат string
    protected static function cleanURL($string, $delimiter = "-")
    {
        if (fusion_get_settings("normalize_seo") == "1") {
            $string = self::normalize($string);
            if (function_exists('iconv')) {
                $string = iconv("UTF-8", "ASCII//TRANSLIT//IGNORE", $string);
            }
        }
        $string = str_replace("&", "&", $string);
        // Must Support &
        //$string = preg_replace("/&([^;]+);/i", "", $string); // Remove all Special entities like ', &#copy;
        //$string = preg_replace("/[^+a-zA-Z0-9_.\/#|+ -\W]/i", "",$string); // # is allowed in some cases(like in threads for #post_10)
        $string = preg_replace("/[\\s]+/i", $delimiter, $string);
        // Replace All <space> by Delimiter
        $string = preg_replace("/[\\" . $delimiter . "]+/i", $delimiter, $string);
        // Replace multiple occurences of Delimiter by 1 occurence only
        //$string = trim($string, "-");
        return (string) $string;
    }