Changeset 47645 for branches/5.2/src/wp-includes/formatting.php
- Timestamp:
- 04/29/2020 04:05:32 PM (6 years ago)
- Location:
- branches/5.2
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/wp-includes/formatting.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/5.2
- Property svn:mergeinfo changed
/trunk merged: 47633-47638
- Property svn:mergeinfo changed
-
branches/5.2/src/wp-includes/formatting.php
r46901 r47645 1999 1999 $filename_raw = $filename; 2000 2000 $special_chars = array( '?', '[', ']', '/', '\\', '=', '<', '>', ':', ';', ',', "'", '"', '&', '$', '#', '*', '(', ')', '|', '~', '`', '!', '{', '}', '%', '+', chr( 0 ) ); 2001 2002 // Check for support for utf8 in the installed PCRE library once and store the result in a static. 2003 static $utf8_pcre = null; 2004 if ( ! isset( $utf8_pcre ) ) { 2005 // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged 2006 $utf8_pcre = @preg_match( '/^./u', 'a' ); 2007 } 2008 2009 if ( ! seems_utf8( $filename ) ) { 2010 $_ext = pathinfo( $filename, PATHINFO_EXTENSION ); 2011 $_name = pathinfo( $filename, PATHINFO_FILENAME ); 2012 $filename = sanitize_title_with_dashes( $_name ) . '.' . $_ext; 2013 } 2014 2015 if ( $utf8_pcre ) { 2016 $filename = preg_replace( "#\x{00a0}#siu", ' ', $filename ); 2017 } 2018 2001 2019 /** 2002 2020 * Filters the list of characters to remove from a filename. … … 2008 2026 */ 2009 2027 $special_chars = apply_filters( 'sanitize_file_name_chars', $special_chars, $filename_raw ); 2010 $filename = preg_replace( "#\x{00a0}#siu", ' ', $filename );2011 2028 $filename = str_replace( $special_chars, '', $filename ); 2012 2029 $filename = str_replace( array( '%20', '+' ), '-', $filename );
Note: See TracChangeset
for help on using the changeset viewer.