aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Util.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Util.cs')
-rw-r--r--OpenSim/Framework/Util.cs20
1 files changed, 20 insertions, 0 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index 9949ad8..dcac9f1 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -898,5 +898,25 @@ namespace OpenSim.Framework
898 { 898 {
899 return UUIDPattern.IsMatch(s); 899 return UUIDPattern.IsMatch(s);
900 } 900 }
901
902 public static string GetDisplayConnectionString(string connectionString)
903 {
904 int passPosition = 0;
905 int passEndPosition = 0;
906 string displayConnectionString = null;
907
908 // hide the password in the connection string
909 passPosition = connectionString.IndexOf("password", StringComparison.OrdinalIgnoreCase);
910 passPosition = connectionString.IndexOf("=", passPosition);
911 if (passPosition < connectionString.Length)
912 passPosition += 1;
913 passEndPosition = connectionString.IndexOf(";", passPosition);
914
915 displayConnectionString = connectionString.Substring(0, passPosition);
916 displayConnectionString += "***";
917 displayConnectionString += connectionString.Substring(passEndPosition, connectionString.Length - passEndPosition);
918
919 return displayConnectionString;
920 }
901 } 921 }
902} 922}