protected function sanitizeUrl($url)
	{
		$url = $url;
		$url = preg_replace('~[^\\pL0-9_]+~u', '-', $url); // substitutes anything but letters, numbers and '_' with separator
		$url = trim($url, "-");
		$url = iconv("utf-8", "us-ascii//TRANSLIT", $url); // TRANSLIT does the whole job
		$url = strtolower($url);
		$url = preg_replace('~[^-a-z0-9_]+~', '', $url); // keep only letters, numbers, '_' and separator
		return $url;
	}
protected function sanitizeUrl($url)
	{
		$url = $url;
		$url = preg_replace('~[^\\pL0-9_]+~u', '-', $url); // substitutes anything but letters, numbers and '_' with separator
		$url = trim($url, "-");
		$url = iconv("utf-8", "us-ascii//TRANSLIT", $url); // TRANSLIT does the whole job
		$url = strtolower($url);
		$url = preg_replace('~[^-a-z0-9_]+~', '', $url); // keep only letters, numbers, '_' and separator
		return $url;
	}
protected function sanitizeUrl ( $ url ) { $ url = $ url ; $ url = preg_replace ( '~[^\\pL0-9_]+~u' , '-' , $ url ) ; // substitutes anything but letters, numbers and '_' with separator $ url = trim ( $ url , "-" ) ; $ url = iconv ( "utf-8" , "us-ascii//TRANSLIT" , $ url ) ; // TRANSLIT does the whole job $ url = strtolower ( $ url ) ; $ url = preg_replace ( '~[^-a-z0-9_]+~' , '' , $ url ) ; // keep only letters, numbers, '_' and separator return $ url ; }
Function for sanitizing slugs
Function for sanitizing slugs