Skip to content

Commit

Permalink
Fixed tag loading in steamtags.php.
Browse files Browse the repository at this point in the history
Just learned that array assignment in PHP is a copy, not a reference.  :/
  • Loading branch information
icculus committed Jul 5, 2010
1 parent 731ecb0 commit 5e66d1b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions steamtags.php
Expand Up @@ -35,9 +35,9 @@ function url_to_simplexml($url)
return simplexml_load_file($url, 'SimpleXMLElement', LIBXML_NOCDATA);
} // url_to_simplexml

function load_profile_game_tags($profile)
function load_profile_game_tags(&$profile)
{
$gamelist = $profile['gamelist'];
$gamelist = &$profile['gamelist'];
$id = $profile['steamid'];
$sql = "select appid, tag from gametags where steamid=$id" .
" and deleted is null order by appid";
Expand All @@ -47,10 +47,9 @@ function load_profile_game_tags($profile)

while ( ($row = db_fetch_array($query)) != false )
{
$game = $gamelist[$row['appid']];
if (!isset($game))
if (!isset($gamelist[$row['appid']]))
continue; // maybe it was a free weekend game they don't own now?
$game['tags'][] = $row['tag'];
$gamelist[$row['appid']]['tags'][] = $row['tag'];
} // while

db_free_result($query);
Expand Down Expand Up @@ -126,7 +125,7 @@ function load_steam_profile($user)
);
} // foreach

$profile['gamelist'] = $gamelist;
$profile['gamelist'] = &$gamelist;

if (!load_profile_game_tags($profile))
{
Expand Down

0 comments on commit 5e66d1b

Please sign in to comment.