PHP Classes

This doesn't look correct

Recommend this page to a friend!

      PHP OAuth Library  >  PHP OAuth Library package blog  >  How to Implement PHP ...  >  All threads  >  This doesn't look correct  >  (Un) Subscribe thread alerts  
Subject:This doesn't look correct
Summary:Flow affected by debug flag
Messages:2
Author:Nick Hustak
Date:2014-05-16 17:56:58
Update:2014-05-16 20:00:10
 

  1. This doesn't look correct   Reply   Report abuse  
Picture of Nick Hustak Nick Hustak - 2014-05-16 17:56:58
oauth_client.php
line: 2326

if($this->debug)
{
if(!$this->GetAccessTokenURL($access_token_url))
return false;
$this->OutputDebug('Checking if OAuth access token was already retrieved from '.$access_token_url);
}

If the debug flag is on, they code has the potential to return a false. This strikes me as a side effect. I was certainly not expecting the debug flag to modify the flow.

  2. Re: This doesn't look correct   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2014-05-16 20:00:10 - In reply to message 1 from Nick Hustak
Yes, there is no problem with that. The GetAccessToken function is only called to take the access token URL and display it in the debug information.

In general that function will not fail. If it fails it is because a sub-class failed to get the access token URL from some storage service.

In that case, even if debug is false, it would also fail elsewhere where the access token URL is really needed.

So there is nothing for you to be concerned. Anyway thanks for the attention in reviewing the code.