Changeset 17614
- Timestamp:
- 04/06/2011 09:28:52 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/formatting.php
r17570 r17614 877 877 * Santizes a html classname to ensure it only contains valid characters 878 878 * 879 * Strips the string down to A-Z,a-z,0-9, '-' if this results in an empty879 * Strips the string down to A-Z,a-z,0-9,_,-. If this results in an empty 880 880 * string then it will return the alternative value supplied. 881 881 * … … 891 891 function sanitize_html_class( $class, $fallback = '' ) { 892 892 //Strip out any % encoded octets 893 $sanitized = preg_replace( '|%[a-fA-F0-9][a-fA-F0-9]|', '', $class);894 895 //Limit to A-Z,a-z,0-9, '-'896 $sanitized = preg_replace( '/[^A-Za-z0-9-]/', '', $sanitized);893 $sanitized = preg_replace( '|%[a-fA-F0-9][a-fA-F0-9]|', '', $class ); 894 895 //Limit to A-Z,a-z,0-9,_,- 896 $sanitized = preg_replace( '/[^A-Za-z0-9_-]/', '', $sanitized ); 897 897 898 898 if ( '' == $sanitized )
Note: See TracChangeset
for help on using the changeset viewer.