File tree 1 file changed +3
-5
lines changed
crypto/src/main/java/org/springframework/security/crypto/password
1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2024 the original author or authors.
2
+ * Copyright 2002-2025 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
19
19
import java .util .HashMap ;
20
20
import java .util .Map ;
21
21
22
- import org .springframework .util .StringUtils ;
23
-
24
22
/**
25
23
* A password encoder that delegates to another PasswordEncoder based upon a prefixed
26
24
* identifier.
@@ -297,10 +295,10 @@ public String encode(CharSequence rawPassword) {
297
295
@ Override
298
296
public boolean matches (CharSequence rawPassword , String prefixEncodedPassword ) {
299
297
String id = extractId (prefixEncodedPassword );
300
- if (StringUtils . hasText ( id )) {
298
+ if (id != null && ! id . isBlank ( )) {
301
299
throw new IllegalArgumentException (String .format (NO_PASSWORD_ENCODER_MAPPED , id ));
302
300
}
303
- if (StringUtils . hasText ( prefixEncodedPassword )) {
301
+ if (prefixEncodedPassword != null && ! prefixEncodedPassword . isBlank ( )) {
304
302
int start = prefixEncodedPassword .indexOf (DelegatingPasswordEncoder .this .idPrefix );
305
303
int end = prefixEncodedPassword .indexOf (DelegatingPasswordEncoder .this .idSuffix , start );
306
304
if (start < 0 && end < 0 ) {
You can’t perform that action at this time.
0 commit comments