xero-php
xero-php copied to clipboard
loadByGuid returns random resource if $guid is null
If a user supplies a null value for $guid
or $guids
for the loadByGuid
and loadByGuids
methods, the code pulls a page of models, and returns the first one, effectively returning a random model.
The code needs to explicitly check that this parameter is not null, before continuing.
I have a fix in a branch - if you give me permissions I can open a PR
@paprikati What do you propose happens if null is passed? For BC, all I can think is throwing a NotFoundException
? For loadByGuids
, that can just return an empty array.
You can make a PR as it stands, not sure what permissions you're after.
Weird - I was struggling to create a branch. Will try again. Yeah the code I wrote throws a NotFoundException
I definitely can't create a branch - even in browser:
can you invite me as a contributor?
@paprikati You need to fork the repository and then (if you want) create a branch in your own fork. You can then make a PR from your fork to upstream (this repo).
Have a read of this