1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
From 412105290d6bc56ffe83c53fdc4347d10114eaf1 Mon Sep 17 00:00:00 2001
From: root <root@postoffice.intern>
Date: Tue, 29 Aug 2023 20:38:20 +0200
Subject: [PATCH] include/php_setup.inc: Hide 'ldap_{search,read}(): Search: No
such object.' errors. They occur rather often and don't hint to an actual
error.
---
include/php_setup.inc | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/include/php_setup.inc b/include/php_setup.inc
index 7aa57f2..429c163 100644
--- a/include/php_setup.inc
+++ b/include/php_setup.inc
@@ -52,6 +52,14 @@ function gosaRaiseError($errno, $errstr, $errfile, $errline)
}
}
+ /* Hide 'ldap_(search|read)(): Search: No such object' messages */
+ if (preg_match('/ldap_(search|read)/', $errstr)){
+ if (preg_match('/No such object/', $errstr)){
+ set_error_handler('gosaRaiseError', E_WARNING | E_NOTICE | E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE | E_STRICT) ;
+ return;
+ }
+ }
+
/* Error messages are hidden in GOsa, so we only send them to the logging class and abort here */
if(isset($config->data) && $config->get_cfg_value("core","displayErrors") != "true"){
--
2.39.2
|