File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
src/Illuminate/Encryption Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -18,19 +18,21 @@ public function register()
1818 $ this ->app ->singleton ('encrypter ' , function ($ app ) {
1919 $ config = $ app ->make ('config ' )->get ('app ' );
2020
21- // If the key starts with "base64:", we will need to decode the key before handing
22- // it off to the encrypter. Keys may be base-64 encoded for presentation and we
23- // want to make sure to convert them back to the raw bytes before encrypting.
24- if (Str::startsWith ($ key = $ config ['key ' ], 'base64: ' )) {
25- $ key = base64_decode (substr ($ key , 7 ));
26- }
21+ $ key = $ config ['key ' ];
2722
2823 if (is_null ($ key ) || $ key === '' ) {
2924 throw new RuntimeException (
3025 'The application encryption key is missing. Run php artisan key:generate to generate it. '
3126 );
3227 }
3328
29+ // If the key starts with "base64:", we will need to decode the key before handing
30+ // it off to the encrypter. Keys may be base-64 encoded for presentation and we
31+ // want to make sure to convert them back to the raw bytes before encrypting.
32+ if (Str::startsWith ($ key , 'base64: ' )) {
33+ $ key = base64_decode (substr ($ key , 7 ));
34+ }
35+
3436 return new Encrypter ($ key , $ config ['cipher ' ]);
3537 });
3638 }
You can’t perform that action at this time.
0 commit comments