{"action":"closed","issue":{"url":"https://api.github.com/repos/envato/wp-envato-market/issues/26","labels_url":"https://api.github.com/repos/envato/wp-envato-market/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/envato/wp-envato-market/issues/26/comments","events_url":"https://api.github.com/repos/envato/wp-envato-market/issues/26/events","html_url":"https://github.com/envato/wp-envato-market/issues/26","id":127131443,"number":26,"title":"set_bearer_args item id check?","user":{"login":"dtbaker","id":543073,"avatar_url":"https://avatars.githubusercontent.com/u/543073?v=3","gravatar_id":"","url":"https://api.github.com/users/dtbaker","html_url":"https://github.com/dtbaker","followers_url":"https://api.github.com/users/dtbaker/followers","following_url":"https://api.github.com/users/dtbaker/following{/other_user}","gists_url":"https://api.github.com/users/dtbaker/gists{/gist_id}","starred_url":"https://api.github.com/users/dtbaker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dtbaker/subscriptions","organizations_url":"https://api.github.com/users/dtbaker/orgs","repos_url":"https://api.github.com/users/dtbaker/repos","events_url":"https://api.github.com/users/dtbaker/events{/privacy}","received_events_url":"https://api.github.com/users/dtbaker/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-17T23:11:52Z","updated_at":"2016-01-17T23:18:46Z","closed_at":"2016-01-17T23:18:46Z","body":"In [`set_bearer_args()`](https://github.com/envato/wp-envato-market/blob/2274d3fecf997c743d88b20c4041dc00202b1a90/inc/admin/admin.php#L180) it does a tripple equal item ID check like this:\r\n\r\n`if ( $item['id'] === $id ) {`\r\n\r\nin [`maybe_deferred_download()`](https://github.com/envato/wp-envato-market/blob/2274d3fecf997c743d88b20c4041dc00202b1a90/inc/admin/admin.php#L159) the item id is taken from a string and passed to `set_bearer_args()`: \r\n\r\n`parse_str( parse_url( $package, PHP_URL_QUERY ), $vars );`\r\n\r\nthe `parse_str()` results in an item_id that is a string.\r\n\r\n```\r\n//var_dump( $vars );\r\narray (size=3)\r\n  'page' => string 'envato-market' (length=13)\r\n  'deferred_download' => string '1' (length=1)\r\n  'item_id' => string '14157442' (length=8)\r\n```\r\n\r\nbut the item_id in the market options array is actually an int:\r\n\r\n```\r\narray (size=2)\r\n  0 => \r\n    array (size=9)\r\n      'id' => int 14157442\r\n      'name' => string 'Beauti..............\r\n```\r\n\r\nUpdates are not working because it doesn't get past the deferred download stage. \r\n\r\nI have no idea why this has just started(?) I'm a bit blurry this monday morning. Am I missing something? Wonder why updates were working previously but not any more? "}}