Changeset 47650 for branches/4.7/src/wp-includes/formatting.php
- Timestamp:
- 04/29/2020 04:22:22 PM (5 years ago)
- Location:
- branches/4.7
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.7
- Property svn:mergeinfo changed
/trunk merged: 47633-47635,47637-47638
- Property svn:mergeinfo changed
-
branches/4.7/src/wp-includes/formatting.php
r45996 r47650 1762 1762 $filename_raw = $filename; 1763 1763 $special_chars = array("?", "[", "]", "/", "\\", "=", "<", ">", ":", ";", ",", "'", "\"", "&", "$", "#", "*", "(", ")", "|", "~", "`", "!", "{", "}", "%", "+", chr(0)); 1764 1765 // Check for support for utf8 in the installed PCRE library once and store the result in a static. 1766 static $utf8_pcre = null; 1767 if ( ! isset( $utf8_pcre ) ) { 1768 // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged 1769 $utf8_pcre = @preg_match( '/^./u', 'a' ); 1770 } 1771 1772 if ( ! seems_utf8( $filename ) ) { 1773 $_ext = pathinfo( $filename, PATHINFO_EXTENSION ); 1774 $_name = pathinfo( $filename, PATHINFO_FILENAME ); 1775 $filename = sanitize_title_with_dashes( $_name ) . '.' . $_ext; 1776 } 1777 1778 if ( $utf8_pcre ) { 1779 $filename = preg_replace( "#\x{00a0}#siu", ' ', $filename ); 1780 } 1781 1764 1782 /** 1765 1783 * Filters the list of characters to remove from a filename. … … 1771 1789 */ 1772 1790 $special_chars = apply_filters( 'sanitize_file_name_chars', $special_chars, $filename_raw ); 1773 $filename = preg_replace( "#\x{00a0}#siu", ' ', $filename );1774 1791 $filename = str_replace( $special_chars, '', $filename ); 1775 1792 $filename = str_replace( array( '%20', '+' ), '-', $filename );
Note: See TracChangeset
for help on using the changeset viewer.