File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
crypto/src/main/java/org/springframework/security/crypto/password Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright 2002-2024 the original author or authors.
2+ * Copyright 2002-2025 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
1919import java .util .HashMap ;
2020import java .util .Map ;
2121
22- import org .springframework .util .StringUtils ;
23-
2422/**
2523 * A password encoder that delegates to another PasswordEncoder based upon a prefixed
2624 * identifier.
@@ -297,10 +295,10 @@ public String encode(CharSequence rawPassword) {
297295 @ Override
298296 public boolean matches (CharSequence rawPassword , String prefixEncodedPassword ) {
299297 String id = extractId (prefixEncodedPassword );
300- if (StringUtils . hasText ( id )) {
298+ if (id != null && ! id . isBlank ( )) {
301299 throw new IllegalArgumentException (String .format (NO_PASSWORD_ENCODER_MAPPED , id ));
302300 }
303- if (StringUtils . hasText ( prefixEncodedPassword )) {
301+ if (prefixEncodedPassword != null && ! prefixEncodedPassword . isBlank ( )) {
304302 int start = prefixEncodedPassword .indexOf (DelegatingPasswordEncoder .this .idPrefix );
305303 int end = prefixEncodedPassword .indexOf (DelegatingPasswordEncoder .this .idSuffix , start );
306304 if (start < 0 && end < 0 ) {
You can’t perform that action at this time.
0 commit comments