Skip to content

Commit

Permalink
Fix second param to preg_match (#78)
Browse files Browse the repository at this point in the history
Co-authored-by: rvogel <vogel@hallowelt.biz>
  • Loading branch information
osnard and rvogel authored Jan 28, 2022
1 parent b0c16cc commit 1024e44
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion includes/Parameters.php
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ private function isRegexValid( $regexes, $forDb = false ) {
// 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;
}
Expand Down

0 comments on commit 1024e44

Please sign in to comment.