cosenary / Instagram-PHP-API

An easy-to-use PHP Class for accessing Instagram's API.
http://cosenary.github.com/Instagram-PHP-API
BSD 3-Clause "New" or "Revised" License
1.46k stars 781 forks source link

Unspecified $limit parameters cause API to return error #125

Closed ahojchris closed 9 years ago

ahojchris commented 9 years ago

Recent updates to the API require that count > 0 when calling search/user. Current code documentation suggests that $limit is optional, but the default $limit value is always passed to the API regardless. Since the API now won't accept 0 as a valid value, it returns an error. To maintain backwards compatibility, this change passes the count value to the API if and only if it has been explicitly set when calling searchUser().

This same pattern (unspecified $limit then turning into an explicit value for count when calling the API) exists for a number of other methods as well. To maintain consistency, the other affected methods which take $limit as an "optional" parameter have been modified to follow the same convention.

murum commented 9 years ago

Please merge this asap. :)

vinkla commented 9 years ago

Thanks for your contribution. I agree this should be fixed asap as we've discussed in many other issues like #119, #120 and #121.

I've added some adjustment that you could take a look at before we merge this in.

vinkla commented 9 years ago

Thanks. Looks much better now. When you're done with all your changes, could you please squash your commits.

ahojchris commented 9 years ago

I squashed my two commits. Let me know if you need me to do anything else.

vinkla commented 9 years ago

LGTM. Good work. Now @cosenary just needs to okay this PR before going further.

vinkla commented 9 years ago

Thanks!