Make WordPress Core


Ignore:
Timestamp:
09/23/2018 03:32:48 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Users: Add LIMIT 1 to SQL query in WP_User::get_data_by(), as only one row is requested.

Props spacedmonkey.
Fixes #43692.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-user.php

    r43582 r43651  
    241241        if ( ! $user = $wpdb->get_row(
    242242            $wpdb->prepare(
    243                 "SELECT * FROM $wpdb->users WHERE $db_field = %s",
     243                "SELECT * FROM $wpdb->users WHERE $db_field = %s LIMIT 1",
    244244                $value
    245245            )
Note: See TracChangeset for help on using the changeset viewer.