Skip to content

Commit 9e1bbad

Browse files
authored
Fix str_replace error when third parameter ($subject) is null (#1511)
* Fix str_replace error when third parameter ($subject) is null in PHP 8.1.0 str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/html/vendor/laravel/passport/src/PassportServiceProvider.php line 268 * Use single quotes to fix style error
1 parent 0f02c6c commit 9e1bbad

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/PassportServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ protected function registerResourceServer()
265265
*/
266266
protected function makeCryptKey($type)
267267
{
268-
$key = str_replace('\\n', "\n", $this->app->make(Config::class)->get('passport.'.$type.'_key'));
268+
$key = str_replace('\\n', "\n", $this->app->make(Config::class)->get('passport.'.$type.'_key') ?? '');
269269

270270
if (! $key) {
271271
$key = 'file://'.Passport::keyPath('oauth-'.$type.'.key');

0 commit comments

Comments
 (0)