Ticket #33756: 33756.3.diff
| File 33756.3.diff, 1.9 KB (added by , 9 years ago) |
|---|
-
src/wp-includes/formatting.php
1851 1851 $username = remove_accents( $username ); 1852 1852 // Kill octets 1853 1853 $username = preg_replace( '|%([a-fA-F0-9][a-fA-F0-9])|', '', $username ); 1854 $username = preg_replace( '/&.+?;/', '', $username ); // Kill entities 1854 // Remove HTML entities. 1855 $username = preg_replace( '/&.+?;/', '', $username ); 1855 1856 1856 1857 // If strict, reduce to ASCII for max portability. 1857 1858 if ( $strict ) … … 1900 1901 } 1901 1902 1902 1903 /** 1903 * Sanitizes a title, or returns a fallback title.1904 * Sanitizes a string, HTML and PHP tags are stripped, and accents are removed, for use as a slug in a URL. 1904 1905 * 1905 * Specifically, HTML and PHP tags are stripped.Further actions can be added1906 * via the plugin API. If $title is empty and $fallback_title is set, the latter1907 * will be used.1906 * Further actions can be added 1907 * via the plugin API. If the sanitized version of $title is empty, and `$fallback_title` is set, 1908 * `$fallback_title` will be returned. 1908 1909 * 1909 1910 * @since 1.0.0 1910 1911 * … … 1951 1952 } 1952 1953 1953 1954 /** 1954 * Sanitizes a title, replacing whitespace and a few other characters with dashes.1955 * Sanitizes a string 1955 1956 * 1956 * Limits the output to alphanumeric characters, underscore (_) and dash (-).1957 * Whitespace becomes a dash.1957 * Output is limited to to alphanumeric characters, underscore (_) and dash (-). 1958 * Various characters (including whitespace) are convered to dashes. 1958 1959 * 1959 1960 * @since 1.2.0 1960 1961 * … … 2008 2009 $title = str_replace( '%c3%97', 'x', $title ); 2009 2010 } 2010 2011 2011 $title = preg_replace('/&.+?;/', '', $title); // kill entities 2012 // Remove HTML entities. 2013 $title = preg_replace('/&.+?;/', '', $title); 2012 2014 $title = str_replace('.', '-', $title); 2013 2015 2014 2016 $title = preg_replace('/[^%a-z0-9 _-]/', '', $title);