Skip to content

Commit

Permalink
Merge pull request #8 from live627/patch-1
Browse files Browse the repository at this point in the history
Fix the anomaly where $urls from profiles is a string
  • Loading branch information
DiegoAndresCortes authored Nov 2, 2022
2 parents 3aef0ed + eef46e3 commit 6d73680
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Sources/Shop/Integration/Who.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,18 @@ public static function who_allowed(&$allowedActions)
*/
public function whos_online_after(&$urls, &$data)
{
global $modSettings;
global $modSettings, $user_info;

// We do nothing if shop is disabled or user can't see it
if (empty($modSettings['Shop_enable_shop']) || !allowedTo('shop_canAccess'))
return;

foreach ($urls as $k => $url)
// Fix the anomaly where $urls is a string when coming from the profile section.
if (!is_array($urls))
$url_list = array(array($urls, $user_info['id']));
else
$url_list = $urls;
foreach ($url_list as $k => $url)
{
// Get the request parameters..
$actions = Database::json_decode($url[0], true);
Expand Down Expand Up @@ -209,4 +214,4 @@ public function trade(&$data)
}
}

}
}

0 comments on commit 6d73680

Please sign in to comment.