mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +00:00
git-svn-id: https://develop.svn.wordpress.org/trunk@4710 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -288,6 +288,17 @@ function remove_accents($string) {
|
||||
return $string;
|
||||
}
|
||||
|
||||
function sanitize_file_name( $name ) { // Like sanitize_title, but with periods
|
||||
$name = strtolower( $name );
|
||||
$name = preg_replace('/&.+?;/', '', $name); // kill entities
|
||||
$name = str_replace( '_', '-', $name );
|
||||
$name = preg_replace('/[^a-z0-9\s-.]/', '', $name);
|
||||
$name = preg_replace('/\s+/', '-', $name);
|
||||
$name = preg_replace('|-+|', '-', $name);
|
||||
$name = trim($name, '-');
|
||||
return $name;
|
||||
}
|
||||
|
||||
function sanitize_user( $username, $strict = false ) {
|
||||
$raw_username = $username;
|
||||
$username = strip_tags($username);
|
||||
|
||||
Reference in New Issue
Block a user