Skip to content

[13.x] Changes strlen comparison to 0 to direct empty string compare#59686

Merged
taylorotwell merged 1 commit into
laravel:13.xfrom
lucasmichot:13.x-strlen
Apr 14, 2026
Merged

[13.x] Changes strlen comparison to 0 to direct empty string compare#59686
taylorotwell merged 1 commit into
laravel:13.xfrom
lucasmichot:13.x-strlen

Conversation

@lucasmichot

Copy link
Copy Markdown
Contributor

Changes strlen comparison to 0 to direct empty string compare

@taylorotwell
taylorotwell merged commit 3eda20c into laravel:13.x Apr 14, 2026
54 checks passed
public function check(#[\SensitiveParameter] $value, $hashedValue, array $options = [])
{
if (is_null($hashedValue) || strlen($hashedValue) === 0) {
if (is_null($hashedValue) || (string) $hashedValue === '') {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will these castings become obsolete in v9? the method signature of strlen() already requires a string, but in practice it does not seem to be enforcing that.

@lucasmichot
lucasmichot deleted the 13.x-strlen branch April 16, 2026 10:06
jonagoldman pushed a commit to deplox/laravel-framework that referenced this pull request Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants