XeroAPI/PHP-Xero — pull request #5 by rawswift (2012-11-13 05:33:46+00:00)
Title: Bug fixes and enhanced README.md

* Give $where variable an initial value, to prevent ugly PHP Notice: Undefined variable.

* Properly encode array filters.

The code below will fail due to a malformed URL, caused by the ampersand not being encoded.

$result = $xero->Invoices(false, false, array("Contact.Name" => "Moe & Curly & Larry") );

Gave me "Signature Invalid" error response: http://blog.xero.com/developer/api-overview/oauth-issues/#signature_invalid

* Prevent doubly encode, for hand-crafted "where" filters.

$result = $xero->Invoices(false, false, "Contact.Name%3d%3d%22Basket%20Case%22%20AND%20Type%3d%3d%22ACCREC%22%20AND%20Status%3d%3d%22AUTHORISED%22" );
// Or
$result = $xero->Invoices(false, false, rawurlencode('Contact.Name=="Basket Case" AND Type=="ACCREC" AND Status=="AUTHORISED"') );

* Enhanced README.md sample codes/snippets, for better readability?