lildude / phpSmug

:camera: phpSmug is a simple object orientated wrapper for the new SmugMug API v2, written in PHP.
https://lildude.github.io/phpSmug
MIT License
42 stars 19 forks source link

Strip empty args from url #53

Closed lildude closed 6 years ago

lildude commented 6 years ago

From https://github.com/lildude/phpSmug/issues/43

When certain unusual URI queries are passed to phpSmug, we sometimes receive the following error:

PHP Notice: Undefined offset: 1 in /vendor/lildude/phpsmug/lib/phpSmug/Client.php on line 139

This is caused when contiguous '&' characters appear in the query statement, effectively creating empty arguments, as seen here between arg1 and arg2:

...?arg1=value1&&arg2=value2

This PR addresses this by stripping out empty arguments as suggested in that issue.

Fixes https://github.com/lildude/phpSmug/issues/43