Skip to content

Commit

Permalink
Added required version parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
hannesvdvreken committed Mar 30, 2014
1 parent f6234b2 commit 748a4a7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions application/libraries/foursquare_api.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function auth_url($callback = FALSE) {
$callback = $this->settings['callback_url'];
}

return 'https://foursquare.com/oauth2/authenticate?client_id=' . $this->settings['client_id'] . '&response_type=code&redirect_uri=' . urlencode($callback);
return 'https://foursquare.com/oauth2/authenticate?v=20120224&client_id=' . $this->settings['client_id'] . '&response_type=code&redirect_uri=' . urlencode($callback);
}

/**
Expand All @@ -58,7 +58,7 @@ function auth_url($callback = FALSE) {
* @return string
*/
function request_token($code) {
$url = 'https://foursquare.com/oauth2/access_token?client_id=' . $this->settings['client_id'] . '&client_secret=' . $this->settings['client_secret'] . '&grant_type=authorization_code&redirect_uri=' . urlencode($this->settings['callback_url']) . '&code=' . $code;
$url = 'https://foursquare.com/oauth2/access_token?v=20120224&client_id=' . $this->settings['client_id'] . '&client_secret=' . $this->settings['client_secret'] . '&grant_type=authorization_code&redirect_uri=' . urlencode($this->settings['callback_url']) . '&code=' . $code;
$json = $this->_get($url);

if (!isset($json->access_token)) {
Expand Down Expand Up @@ -90,9 +90,9 @@ function api($uri, $data = array(), $method = 'GET') {
}

if (strtoupper($method) == 'POST') {
$json = $this->_post('https://api.foursquare.com/v2/' . $uri . '?' . http_build_query($params), $data);
$json = $this->_post('https://api.foursquare.com/v2/' . $uri . '?v=20120224&' . http_build_query($params), $data);
} else {
$json = $this->_get('https://api.foursquare.com/v2/' . $uri . '?' . http_build_query(array_merge($params, $data)));
$json = $this->_get('https://api.foursquare.com/v2/' . $uri . '?v=20120224&' . http_build_query(array_merge($params, $data)));
}

if (!$json) {
Expand Down

0 comments on commit 748a4a7

Please sign in to comment.