summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2015-03-06 08:57:41 (GMT)
committerAleksander Machniak <machniak@kolabsys.com>2015-03-06 08:57:41 (GMT)
commit3f80fd1b8b5f1344391740f142dec5ac6cfbe07d (patch)
treeb7997267b4bb0a69f2624afb6390e184607cfee9
parent8d180afa12bc87be916f96a13c2cdd6bde673242 (diff)
downloadkolab-wap-3f80fd1b8b5f1344391740f142dec5ac6cfbe07d.tar.gz
Do not log database password (#4806)
-rw-r--r--lib/SQL.php3
-rw-r--r--lib/SQL/oracle.php3
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/SQL.php b/lib/SQL.php
index add6fa6..102f59d 100644
--- a/lib/SQL.php
+++ b/lib/SQL.php
@@ -105,7 +105,8 @@ class SQL
protected function connect()
{
if (!$this->conn && !$this->conn_tried) {
- Log::debug("SQL: Connecting to " . $this->sql_uri);
+ $passwd_regex = '|^([a-zA-Z0-9]+://[^:]+:)[^@]+|';
+ Log::debug("SQL: Connecting to " . preg_replace($passwd_regex, '\\1***', $this->sql_uri));
$this->conn_tried = true;
diff --git a/lib/SQL/oracle.php b/lib/SQL/oracle.php
index 4bc072c..9296474 100644
--- a/lib/SQL/oracle.php
+++ b/lib/SQL/oracle.php
@@ -36,7 +36,8 @@ class SQL_oracle extends SQL
protected function connect()
{
if (!$this->conn && !$this->conn_tried) {
- Log::debug("SQL: Connecting to " . $this->sql_uri);
+ $passwd_regex = '|^([a-zA-Z0-9]+://[^:]+:)[^@]+|';
+ Log::debug("SQL: Connecting to " . preg_replace($passwd_regex, '\\1***', $this->sql_uri));
$this->conn_tried = true;