Skip to content

Commit

Permalink
Merge pull request #67 from XboxLeaders/develop
Browse files Browse the repository at this point in the history
! Two issue fixes
  • Loading branch information
Jason Clemons committed Mar 10, 2014
2 parents e038a73 + a648a55 commit c17f319
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions includes/classes/api.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,14 +229,14 @@ public function fetch_achievements($gamertag, $gameid, $region)
public function fetch_games($gamertag, $region)
{
$gamertag = trim($gamertag);
$url = 'https://live.xbox.com/' . $region . '/Activity?compareTo=' . urlencode($gamertag);
$url = 'https://live.xbox.com/' . $region . '/Activity';
$key = $this->version . ':games.' . $gamertag;
$data = $this->__cache->fetch($key);
$freshness = 'from cache';

if (!$data) {
$data = $this->fetch_url($url);
$post_data = '__RequestVerificationToken=' . urlencode(trim($this->find($data, '<input name="__RequestVerificationToken" type="hidden" value="', '" />')));
$post_data = '__RequestVerificationToken=' . urlencode(trim($this->find($data, '<input name="__RequestVerificationToken" type="hidden" value="', '" />'))) . '&compareTo=' . urlencode($gamertag);
$headers = array('X-Requested-With: XMLHttpRequest', 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8');
$data = $this->fetch_url('https://live.xbox.com/' . $region . '/Activity/Summary?compareTo=' . urlencode($gamertag) . '&lc=1033', $url, 10, $post_data, $headers);
$freshness = 'new';
Expand Down
4 changes: 2 additions & 2 deletions includes/classes/base.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ public function __construct($cache)
public function init($email, $password)
{
// Email and password. Make sure it's URL-friendly.
$this->email = str_replace('@', '%40', strtolower($email));
$this->password = $password;
$this->email = urlencode($email);
$this->password = urlencode($password);

// Check the login session to make sure it's valid.
if ($this->check_login()) {
Expand Down

0 comments on commit c17f319

Please sign in to comment.