public/wordpress/wp-content/plugins/wp-courseware/includes/legacy/functions.php
/**
 * Converts a list of raw file extensions into a list of permitted file extensions.
 *
 * @since 1.0.0
 *
 * @param string $rawInput The list of raw file extensions.
 *
 * @return array The list of file extensions.
 */
Converts a list of raw file extensions into a list of permitted file extensions.

@param string $rawInput The list of raw file extensions.

@return array The list of file extensions.
Converts a list of raw file extensions into a list of permitted file extensions . @param string $rawInput The list of raw file extensions . @return array The list of file extensions .
function WPCW_files_cleanFileExtensionList( $rawInput ) {
	$list = array();
	$rawList = explode( ',', $rawInput );
	if ( ! empty( $rawList ) ) {
		foreach ( $rawList as $ext ) {
			$ext = strtolower( $ext );
			$ext = preg_replace( '/[^a-z0-9]/', '', $ext ); 
			if ( $ext ) {
				$list[] = $ext;
			}
		}
	}
	return $list;
}
function WPCW_files_cleanFileExtensionList ( $ rawInput ) { $ list = array ( ) ; $ rawList = explode ( ',' , $ rawInput ) ; if ( ! empty ( $ rawList ) ) { foreach ( $ rawList as $ ext ) { $ ext = strtolower ( $ ext ) ; $ ext = preg_replace ( '/[^a-z0-9]/' , '' , $ ext ) ; if ( $ ext ) { $ list [ ] = $ ext ; } } } return $ list ; }
Converts a list of raw file extensions into a list of permitted file extensions.
Converts a list of raw file extensions into a list of permitted file extensions .
// Turn comma list into array of items // Check each item // Remove anything other than numbers and letters. // Got anything left? Add it to the list.