Bug Quick Reply error when no users have trophies

Status
Not open for further replies.

Fillip H.

Staff member
Owner
Developer
Customer
Presumably when no users have any trophies, $trophies in
PHP:
if (array_key_exists($post['userid'], $trophies))
(found in the vBArcade - Render Postbit Trophies plugin) is null, causing the following error when posting a new post via Quick Reply:

Code:
<br /> <b>Warning</b>:  array_key_exists() expects parameter 2 to be array, null given in <b>/home/dbtech/public_html/includes/class_postbit.php(345) : eval()'d code</b> on line <b>21</b><br />

This error causes the "Do you wish to leave this page?" popup, and is only visible via Firebug (as it's an AJAX error).

For anyone else having this issue, I fixed it by replacing the above code with
PHP:
if (array_key_exists($post['userid'], (array)$trophies))
(typecasting $trophies to array) :)
 
Status
Not open for further replies.

Similar threads

Legacy vBArcade

vBulletin 4.x.x
Seller
DragonByte Technologies
Release date
Last update
Total downloads
899
Customer rating
0.00 star(s) 0 ratings
Top