alexis-mignon / python-flickr-api

A python implementation of the Flickr API
BSD 3-Clause "New" or "Revised" License
367 stars 108 forks source link

Search with epoch containing hundredth of seconds will return all #94

Open lukrido opened 6 years ago

lukrido commented 6 years ago

Hello

If the epoch has a decimal in min_taken_date/max_taken_date/min_upload_date/max_upload_date, the API returns the complete set of pictures instead of the search request. Such decimal is caused by the hundredth of seconds in the epoch notation. 1527638245 is valid, but 1527638245.75 isn't. This can be reproduced here: https://www.flickr.com/services/api/explore/flickr.photos.search

Should the epoch automatically be converted to an integer to make sure we are always on the safe side?

Cheers,

mtrovo commented 6 years ago

That's really a strange behaviour, it seems the input validation on their side is broken for date fields.

It would be cool to have a way to sanitize arguments to avoid this kind of problem, I think we can have a type field on the objects on methods.py file and do a validation phase before sending the request.