Skip to content

Commit

Permalink
Check for null value when generating OAuth hash
Browse files Browse the repository at this point in the history
Avoids deprecation message in PHP 8.1+
  • Loading branch information
spvickers committed Jun 13, 2023
1 parent 6c2fdaf commit 4c33db8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/System.php
Original file line number Diff line number Diff line change
Expand Up @@ -1559,6 +1559,9 @@ private function addOAuth1Signature($endpoint, $data, $method, $type, $hash, $ti

if (!is_array($data)) {
if (empty($hash)) { // Calculate body hash
if (is_null($data)) {
$data = '';
}
switch ($this->signatureMethod) {
case 'HMAC-SHA224':
$hash = base64_encode(hash('sha224', $data, true));
Expand Down

0 comments on commit 4c33db8

Please sign in to comment.