Ticket #46388: 46388.diff
File 46388.diff, 851 bytes (added by , 4 years ago) |
---|
-
src/wp-includes/class-wp-user.php
233 233 } 234 234 235 235 if ( false !== $user_id ) { 236 // Prevent non-existent users from triggering multiple queries 237 $notusers = wp_cache_get( 'notusers', 'users' ); 238 if ( isset( $notusers[ $user_id ] ) ) { 239 return false; 240 } 241 236 242 if ( $user = wp_cache_get( $user_id, 'users' ) ) { 237 243 return $user; 238 244 } … … 244 250 $value 245 251 ) 246 252 ) ) { 253 // User does not exist, so we must cache its non-existence 254 if ( ! is_array( $notusers ) ) { 255 $notusers = array(); 256 } 257 258 $notusers[ $user_id ] = true; 259 wp_cache_set( 'notusers', $notusers, 'users' ); 260 247 261 return false; 248 262 } 249 263