Skip to content

Commit

Permalink
Merge pull request #293 from LadySolveig/LadySolveig-patch-fix-deprec…
Browse files Browse the repository at this point in the history
…ated-strlen-OAuth-php8.1

Fix - Deprecated PHP 8.1
  • Loading branch information
escopecz authored Apr 12, 2023
2 parents 846a4f1 + 1078e2c commit 3b96c2d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/Auth/OAuth.php
Original file line number Diff line number Diff line change
Expand Up @@ -385,14 +385,14 @@ public function validateAccessToken($redirect = true)
}

//Check for existing access token
if (strlen($this->_access_token) > 0) {
if ($this->_access_token) {
$this->log('has access token');

return true;
}

//Reauthorize if no token was found
if (0 == strlen($this->_access_token)) {
if (!$this->_access_token) {
$this->log('access token empty so authorize');

//OAuth flows
Expand Down Expand Up @@ -522,7 +522,7 @@ protected function getQueryParameters($isPost, $parameters)
*/
protected function isOauth1()
{
return !empty($this->_request_token_url) && strlen($this->_request_token_url) > 0;
return !empty($this->_request_token_url);
}

/**
Expand Down Expand Up @@ -634,7 +634,7 @@ protected function requestAccessToken($method = 'POST', array $params = [], $res
$parameters['code'] = $_GET['code'];
}

if (strlen($this->_refresh_token) > 0) {
if ($this->_refresh_token) {
$this->log('Using refresh token');
$parameters['grant_type'] = 'refresh_token';
$parameters['refresh_token'] = $this->_refresh_token;
Expand Down

0 comments on commit 3b96c2d

Please sign in to comment.