Skip to content

Commit

Permalink
Users: Add LIMIT 1 to SQL query in WP_User::get_data_by(), as onl…
Browse files Browse the repository at this point in the history
…y one row is requested.

Props spacedmonkey.
Fixes #43692.
Built from https://develop.svn.wordpress.org/trunk@43651


git-svn-id: http://core.svn.wordpress.org/trunk@43480 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
SergeyBiryukov committed Sep 23, 2018
1 parent 2e8c823 commit 727cdc9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion wp-includes/class-wp-user.php
Expand Up @@ -240,7 +240,7 @@ public static function get_data_by( $field, $value ) {

if ( ! $user = $wpdb->get_row(
$wpdb->prepare(
"SELECT * FROM $wpdb->users WHERE $db_field = %s",
"SELECT * FROM $wpdb->users WHERE $db_field = %s LIMIT 1",
$value
)
) ) {
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/version.php
Expand Up @@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.0-alpha-43650';
$wp_version = '5.0-alpha-43651';

/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
Expand Down

0 comments on commit 727cdc9

Please sign in to comment.