From 727cdc94c902b72731fd462bab2cf47629a0674a Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 23 Sep 2018 15:33:24 +0000 Subject: [PATCH] Users: Add `LIMIT 1` to SQL query in `WP_User::get_data_by()`, as only 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 --- wp-includes/class-wp-user.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/class-wp-user.php b/wp-includes/class-wp-user.php index fb79242f5f..620aecd024 100644 --- a/wp-includes/class-wp-user.php +++ b/wp-includes/class-wp-user.php @@ -240,7 +240,7 @@ class WP_User { 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 ) ) ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index e97f37c29e..d6ffc6ed30 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.