public/wordpress/wp-content/plugins/wp-courseware/includes/legacy/admin/functions.php
/**
 * Takes a string and makes it safe for a URL.
 *
 * @since 1.0.0
 *
 * @param string $urlString The string to make safe.
 *
 * @return string A string safe enough to use as a URL.
 */
Takes a string and makes it safe for a URL.

@param string $urlString The string to make safe.

@return string A string safe enough to use as a URL.
Takes a string and makes it safe for a URL . @param string $urlString The string to make safe . @return string A string safe enough to use as a URL .
function WPCW_urls_createCleanURL( $urlString ) {
	$urlString = trim( strtolower( $urlString ) );
	$urlString = preg_replace( '%[\(\[\]\)]%', '', $urlString );
	$urlString = preg_replace( '%[^0-9a-z\-]%', '-', $urlString );
	$urlString = preg_replace( '%[\-]+%', '-', $urlString );
	$urlString = rtrim( $urlString, '-' );
	return $urlString;
}
function WPCW_urls_createCleanURL ( $ urlString ) { $ urlString = trim ( strtolower ( $ urlString ) ) ; $ urlString = preg_replace ( '%[\(\[\]\)]%' , '' , $ urlString ) ; $ urlString = preg_replace ( '%[^0-9a-z\-]%' , '-' , $ urlString ) ; $ urlString = preg_replace ( '%[\-]+%' , '-' , $ urlString ) ; $ urlString = rtrim ( $ urlString , '-' ) ; return $ urlString ; }
Takes a string and makes it safe for a URL.
Takes a string and makes it safe for a URL .
// Remove brackets completely // Remove non-alpha characters // Replace long sequences of hypens with a single hyphen // Remove the last hypen (if there is one)