Changeset 14602 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/admin/class-user-registrations-list-table.php
- Timestamp:
- 11/12/2025 04:43:43 AM (11 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/admin/class-user-registrations-list-table.php
r14533 r14602 181 181 $search_term = wp_unslash( $_GET['s'] ); 182 182 $search_like = '%' . $wpdb->esc_like( $search_term ) . '%'; 183 183 184 184 // Limit searches to where they're likely, for performance. 185 185 if ( str_contains( $search_term, '@' ) ) { 186 $san_search_term = wporg_sanitize_email_for_search( $search_term ); 187 $san_search_like = '%' . $wpdb->esc_like( $san_search_term ) . '%'; 188 186 189 // If it looks like a full email, exact match. 187 190 if ( preg_match( '/^.{3,}@.+[.].+$/', $search_term ) ) { 188 191 // Looks like an email, so just search the emails. 189 192 $where .= $wpdb->prepare( 190 "AND registrations.user_email = %s", 191 $search_term 193 "AND ( registrations.user_email = %s OR registrations.user_email_san = %s )", 194 $search_term, 195 $san_search_term 192 196 ); 193 197 } else { 194 198 // Otherwise, a wildcard on the email. 195 199 $where .= $wpdb->prepare( 196 "AND registrations.user_email LIKE %s", 197 $search_like 200 "AND ( registrations.user_email LIKE %s OR registrations.user_email_san LIKE %s )", 201 $search_like, 202 $san_search_like 198 203 ); 199 204 } … … 216 221 registrations.user_login LIKE %s OR 217 222 registrations.user_email LIKE %s OR 223 registrations.user_email_san LIKE %s OR 218 224 registrations.meta LIKE %s OR 219 225 description.meta_value LIKE %s 220 226 )", 221 $search_like, $search_like, $search_like, $search_like 227 $search_like, $search_like, $search_like, $search_like, $search_like 222 228 ); 223 229 }
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)