Changeset 8902
- Timestamp:
- 05/31/2019 07:51:49 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php
r8894 r8902 868 868 $wp_query->query_vars['post_status'][] = 'disabled'; 869 869 $wp_query->query_vars['post_status'] = array_unique( $wp_query->query_vars['post_status'] ); 870 } 871 872 // Sanitize / cleanup the search query a little bit. 873 if ( $wp_query->is_search() ) { 874 $s = $wp_query->get( 's' ); 875 $s = urldecode( $s ); 876 877 // If a URL-like request comes in, reduce to a slug 878 if ( preg_match( '!^http.+/plugins/([^/]+)(/|$)!i', $s, $m ) ) { 879 $s = $m[1]; 880 } 881 882 // Jetpack Search has a limit, limit to 200char. This is intentionally using ASCII length + Multibyte substr. 883 if ( strlen( $s ) > 200 ) { 884 $s = mb_substr( $s, 0, 200 ); 885 } 886 887 // Trim off special characters, only allowing wordy characters at the end of searches.s 888 $s = preg_replace( '!(\W+)$!i', '', $s ); 889 // ..and whitespace 890 $s = trim( $s ); 891 892 $wp_query->set( 's', $s ); 870 893 } 871 894
Note: See TracChangeset
for help on using the changeset viewer.