Skip to content

Commit

Permalink
Fix php notice on news page
Browse files Browse the repository at this point in the history
Fixes #22230
  • Loading branch information
vboctor committed Jan 22, 2017
1 parent 9bf1d34 commit 034ee01
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions core/user_api.php
Expand Up @@ -77,16 +77,20 @@
function user_cache_row( $p_user_id, $p_trigger_errors = true ) {
global $g_cache_user;

if( !isset( $g_cache_user[$p_user_id] ) ) {
user_cache_array_rows( array( $p_user_id ) );
$c_user_id = (int)$p_user_id;

if( !isset( $g_cache_user[$c_user_id] ) ) {
user_cache_array_rows( array( $c_user_id ) );
}
$t_user_row = $g_cache_user[$p_user_id];

$t_user_row = $g_cache_user[$c_user_id];

if( !$t_user_row ) {
if( $p_trigger_errors ) {
error_parameters( (integer)$p_user_id );
trigger_error( ERROR_USER_BY_ID_NOT_FOUND, ERROR );
}

return false;
}

Expand Down

0 comments on commit 034ee01

Please sign in to comment.