Semantics3 / semantics3-php

DEPRECATED PHP library bindings for the Semantics3 APIs
MIT License
24 stars 21 forks source link

Potential security issue #25

Open localheinz opened 7 years ago

localheinz commented 7 years ago

If we look at Api_Connector, we can see the following:

public function run_query($endpoint, $params, $method="GET", array $requestOptions = [])
{
    // ...

    try {
        // ...
    } catch(OAuthException2 $e) {
        print "\n";
        $error = $e->getMessage();
        print $error."\n";
    }
}

To me this seems like a two-fold problem:

Seems like the only way to fix this in consuming code would be to use output buffering, so how about fixing it here instead?

The best and easiest way would be to just let the exception bubble up and let consuming code handle it, instead.