Skip to content

Commit

Permalink
Cache latest data in function user_cache_database_result
Browse files Browse the repository at this point in the history
The functions did not return a value in all cases.
There is no place in code where the return value of the function is used.

The cache was not updated with latest data if's been set before.

Fixes #20551
  • Loading branch information
atrol committed Aug 22, 2016
1 parent c7bb7f7 commit 694873e
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions core/user_api.php
Expand Up @@ -130,17 +130,13 @@ function user_cache_array_rows( array $p_user_id_array ) {
}

/**
* Cache an object as a bug.
* Cache a user row
* @param array $p_user_database_result A user row to cache.
* @return array|null
* @return void
*/
function user_cache_database_result( array $p_user_database_result ) {
global $g_cache_user;

if( isset( $g_cache_user[$p_user_database_result['id']] ) ) {
return $g_cache_user[$p_user_database_result['id']];
}

$g_cache_user[$p_user_database_result['id']] = $p_user_database_result;
}

Expand Down

0 comments on commit 694873e

Please sign in to comment.