leonjza / PHPNessusNG

PHP wrapper functions for interfacing with the Nessus V6.x API
MIT License
15 stars 9 forks source link

Proper handling of empty responses #16

Closed pdscopes closed 7 years ago

pdscopes commented 7 years ago

Hi again,

Embarrassingly, it seems that I did not properly fix the problem with empty responses with my first pull request. I have now corrected myself, sorry for the inconvenience I've caused!

It turns out json_decode('') causes json_last_error() and json_last_error_msg() to response with 4 and Syntax Error respectively. To resolve to issue I added an extra conditional check for empty strings before the json_decode.

leonjza commented 7 years ago

No worries! Thanks for the quick PR to get it fixed 👍 I'll test asap.

leonjza commented 7 years ago

Merged tagged release 1.0.7 with this. Also setup Travis while we at it ;)

Thanks for your contribution!

pdscopes commented 7 years ago

Not a problem. Thanks for originally writing the library and maintaining it!

On 26 Oct 2016 06:55, "Leon Jacobs" notifications@github.com wrote:

Merged tagged release 1.0.7 with this. Also setup Travis while we at it ;)

Thanks for your contribution!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/leonjza/PHPNessusNG/pull/16#issuecomment-256256296, or mute the thread https://github.com/notifications/unsubscribe-auth/AMtksvnrWrT7lzAWQO9e7gb1d4-Sv8Boks5q3utNgaJpZM4Kf9_f .