Fix second param to preg_match (#78)

Co-authored-by: rvogel <vogel@hallowelt.biz>
This commit is contained in:
Robert Vogel 2022-01-28 18:07:27 +01:00 committed by GitHub
parent b0c16cc660
commit 1024e445ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -407,7 +407,7 @@ class Parameters extends ParametersData {
// would throw an error due to a bad regex from user input.
// phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged
if ( @preg_match( $regex, null ) === false ) {
if ( @preg_match( $regex, '' ) === false ) {
// @phan-suppress-previous-line PhanParamSuspiciousOrder, PhanTypeMismatchArgumentInternalProbablyReal
return false;
}