getUser => error

  • Thread starter Thread starter Deleted member 10469
  • Start date Start date
D

Deleted member 10469

Guest
Hello, I have an error:

error:
Fatal error: [] operator not supported for strings in /home/zephyr62/www/ElderScrolls/Forum/library/KingK/BbCodeManager/BbCode/Formatter/Default.php on line 54


$user = XenForo_Model::create('XenForo_Model_User')->getUserById($idMember);
$usernameList[] = $user['username']; (line 54)


var_dump($user['username'])

show:
1evyc.jpg


If user enter a bad id, I have this error, how prevent that please ? :)
Possible to remove automatic the nulled value ?

Thank.
 
PHP:
$user = XenForo_Model::create('XenForo_Model_User')->getUserById($idMember);
if (is_array($user) && isset($user['username'])) {
  $usernameList[] = $user['username'];
}
 
Niquel merci, j'avais oublié que j'était dans une boucle ^^
 
Back
Top Bottom