Skip to content

Commit 9d80189

Browse files
authored
Fix replacing required :input with null on PHP 8.1 (#36622)
Fixes an issue where data lacking one or more of the fields under validation will cause tests to fail with an `ErrorException`. That exception is a PHP deprecation warning triggered by the call to `str_replace()` inside `replaceInputPlaceholder()`, which assumes the value returned from `getDisplayableValue()` will always be a string.
1 parent 0a89a87 commit 9d80189

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Illuminate/Validation/Concerns/FormatsMessages.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ public function getDisplayableValue($attribute, $value)
336336
return $value ? 'true' : 'false';
337337
}
338338

339-
return $value;
339+
return (string) $value;
340340
}
341341

342342
/**

0 commit comments

Comments
 (0)