Skip to content

Subscribe and unsubscribe response when boolean = true

edited January 2013 in Troubleshooting

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.

Comments

  • BenBen
    edited April 2013

    true and 1 is essentially the same thing.

    If you spit the result in the browser, a real true boolean will be displayed as 1. 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

This discussion has been closed.