関数 sanitize_html_class()
2014/12/11
関数 sanitize_html_class()
定義ファイル :/blog/wp-includes/formatting.php 3
1 2 3 4 5 6 7 8 9 10 11 | function sanitize_html_class( $class, $fallback = '' ) { //Strip out any % encoded octets $sanitized = preg_replace( '|%[a-fA-F0-9][a-fA-F0-9]|', '', $class ); //Limit to A-Z,a-z,0-9,_,- $sanitized = preg_replace( '/[^A-Za-z0-9_-]/', '', $sanitized ); if ( '' == $sanitized ) $sanitized = $fallback; return apply_filters( 'sanitize_html_class', $sanitized, $class, $fallback ); } |