Subscribe and unsubscribe response when boolean = true
On the subscribe and unsubscribe request with boolean=true, the response is not the same with the document. It says api will return "true", but actually it return "1". It is based on the following php code on subscribe.php:387,
echo true;
You know when the boolean will convert to string, it will be converted to integer, that means true become "1". Please fix in the next version.
This discussion has been closed.
Comments
true
and1
is essentially the same thing.If you spit the result in the browser, a real
true
boolean will be displayed as1
. If not, it is a string, not a boolean.When you test for a result in your code like so:
if($subscribed == true)
or
if($subscribed == 1)
or
if($subscribed)
it will all be positive.
You can download this simple script I've written to test it out.
Thanks.
Ben