diff options
author | lbsa71 | 2009-02-17 14:12:57 +0000 |
---|---|---|
committer | lbsa71 | 2009-02-17 14:12:57 +0000 |
commit | 93465df5e3cdab1774216fbf3f741af03aa609f7 (patch) | |
tree | bb52b80891584a591b6d9cfbf96eb11404fd96d4 /OpenSim/Framework/Util.cs | |
parent | Re-add the objectID field to the anim pack, that was deemed unneccessary (diff) | |
download | opensim-SC-93465df5e3cdab1774216fbf3f741af03aa609f7.zip opensim-SC-93465df5e3cdab1774216fbf3f741af03aa609f7.tar.gz opensim-SC-93465df5e3cdab1774216fbf3f741af03aa609f7.tar.bz2 opensim-SC-93465df5e3cdab1774216fbf3f741af03aa609f7.tar.xz |
* Moved the nifty MySQLEstateData connectionstring password-stripper out into the Util project
Diffstat (limited to 'OpenSim/Framework/Util.cs')
-rw-r--r-- | OpenSim/Framework/Util.cs | 20 |
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 | } |