[icinga-checkins] icinga.org: icingaweb2/master: Check the correct return type in case preg_replace fails in ExternalBackend.php

git at icinga.org git at icinga.org
Wed Nov 16 14:11:18 CET 2016


Module: icingaweb2
Branch: master
Commit: f7e5cd3b71bc417034d534e2ee6d1952b7da0c6e
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=f7e5cd3b71bc417034d534e2ee6d1952b7da0c6e

Author: Eric Lippmann <eric.lippmann at icinga.com>
Date:   Wed Nov 16 14:10:31 2016 +0100

Check the correct return type in case preg_replace fails in ExternalBackend.php

---

 library/Icinga/Authentication/User/ExternalBackend.php |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/library/Icinga/Authentication/User/ExternalBackend.php b/library/Icinga/Authentication/User/ExternalBackend.php
index 3baf1c8..c92bbd6 100644
--- a/library/Icinga/Authentication/User/ExternalBackend.php
+++ b/library/Icinga/Authentication/User/ExternalBackend.php
@@ -83,7 +83,7 @@ class ExternalBackend implements UserBackendInterface
 
             if ($this->stripUsernameRegexp) {
                 $stripped = preg_replace($this->stripUsernameRegexp, '', $username);
-                if ($stripped !== false) {
+                if ($stripped !== null) {
                     // TODO(el): PHP issues a warning when PHP cannot compile the regular expression. Should we log an
                     // additional message in that case?
                     $username = $stripped;



More information about the icinga-checkins mailing list