From edb58dfe157165b01c38157e26e016a332aceabd Mon Sep 17 00:00:00 2001
From: Alex Pott <alex.a.pott@googlemail.com>
Date: Tue, 14 Jan 2020 15:49:34 +0000
Subject: [PATCH] =?UTF-8?q?Issue=20#3062101=20by=20Krzysztof=20Doma=C5=84s?=
 =?UTF-8?q?ki,=20larowlan:=20Incorrect=20data=20type=20when=20the=20preg?=
 =?UTF-8?q?=5Fmatch=20function=20is=20used=20as=20the=20result=20of=20anot?=
 =?UTF-8?q?her=20function?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 core/modules/color/color.module                                 | 2 +-
 .../modules/comment/tests/src/Functional/CommentNonNodeTest.php | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/core/modules/color/color.module b/core/modules/color/color.module
index 8a118d7cd004..eb36f30cafaa 100644
--- a/core/modules/color/color.module
+++ b/core/modules/color/color.module
@@ -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);
 }
 
 /**
diff --git a/core/modules/comment/tests/src/Functional/CommentNonNodeTest.php b/core/modules/comment/tests/src/Functional/CommentNonNodeTest.php
index 0359aa01cdd3..318e0ca9a75f 100644
--- a/core/modules/comment/tests/src/Functional/CommentNonNodeTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentNonNodeTest.php
@@ -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());
   }
 
   /**
-- 
GitLab