Commit edb58dfe authored by alexpott's avatar alexpott

Issue #3062101 by Krzysztof Domański, larowlan: Incorrect data type when the...

Issue #3062101 by Krzysztof Domański, larowlan: Incorrect data type when the preg_match function is used as the result of another function
parent b28a392e
......@@ -334,7 +334,7 @@ function color_palette_color_value($element, $input, FormStateInterface $form_st
* isn't.
*/
function color_valid_hexadecimal_string($color) {
return preg_match('/^#([a-f0-9]{3}){1,2}$/iD', $color);
return (bool) preg_match('/^#([a-f0-9]{3}){1,2}$/iD', $color);
}
/**
......
......@@ -211,7 +211,7 @@ public function commentExists(CommentInterface $comment = NULL, $reply = FALSE)
* Contact info is available.
*/
public function commentContactInfoAvailable() {
return preg_match('/(input).*?(name="name").*?(input).*?(name="mail").*?(input).*?(name="homepage")/s', $this->getSession()->getPage()->getContent());
return (bool) preg_match('/(input).*?(name="name").*?(input).*?(name="mail").*?(input).*?(name="homepage")/s', $this->getSession()->getPage()->getContent());
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment