Skip to content

Commit ea8f680

Browse files
Spice-Kingmgruner
authored andcommitted
Fix PHP 8.1 deprecation warning for NULL on_behalf_of_user
Fixes #49, empty handles both null and empty string just fine
1 parent 2724628 commit ea8f680

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ private function request ( $method, $url, array $url_parameters = [], array $opt
7272
$options['headers']['Content-Type'] = 'application/json; charset=utf-8';
7373

7474
// Set "on behalf of user" header
75-
if ( mb_strlen($this->on_behalf_of_user) ) {
75+
if ( !empty($this->on_behalf_of_user) ) {
7676
$options['headers']['X-On-Behalf-Of'] = $this->on_behalf_of_user;
7777
}
7878

0 commit comments

Comments
 (0)