diff options
author | Justin Clark-Casey (justincc) | 2014-05-15 22:45:01 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2014-05-15 22:45:01 +0100 |
commit | 6dc1b113d0a7cdf3d7b6d567728d39568f1ed982 (patch) | |
tree | 32c9c2199baa31a9464465c25b23fe25afa6ca6e /OpenSim/Data/PGSQL/PGSQLGroupsData.cs | |
parent | Escape find string in MySQL core groups plugin (diff) | |
download | opensim-SC-6dc1b113d0a7cdf3d7b6d567728d39568f1ed982.zip opensim-SC-6dc1b113d0a7cdf3d7b6d567728d39568f1ed982.tar.gz opensim-SC-6dc1b113d0a7cdf3d7b6d567728d39568f1ed982.tar.bz2 opensim-SC-6dc1b113d0a7cdf3d7b6d567728d39568f1ed982.tar.xz |
Escape find string in PgSQL core groups plugin
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/PGSQL/PGSQLGroupsData.cs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/OpenSim/Data/PGSQL/PGSQLGroupsData.cs b/OpenSim/Data/PGSQL/PGSQLGroupsData.cs index ed75b63..15c965b 100644 --- a/OpenSim/Data/PGSQL/PGSQLGroupsData.cs +++ b/OpenSim/Data/PGSQL/PGSQLGroupsData.cs | |||
@@ -83,11 +83,15 @@ namespace OpenSim.Data.PGSQL | |||
83 | public GroupData[] RetrieveGroups(string pattern) | 83 | public GroupData[] RetrieveGroups(string pattern) |
84 | { | 84 | { |
85 | if (string.IsNullOrEmpty(pattern)) // True for where clause | 85 | if (string.IsNullOrEmpty(pattern)) // True for where clause |
86 | { | ||
86 | pattern = " true ORDER BY lower(\"Name\") LIMIT 100"; | 87 | pattern = " true ORDER BY lower(\"Name\") LIMIT 100"; |
88 | return m_Groups.Get(pattern); | ||
89 | } | ||
87 | else | 90 | else |
88 | pattern = string.Format(" lower(\"Name\") LIKE lower('%{0}%') ORDER BY lower(\"Name\") LIMIT 100", pattern); | 91 | { |
89 | 92 | pattern = string.Format(" lower(\"Name\") LIKE lower('%:pattern%') ORDER BY lower(\"Name\") LIMIT 100"); | |
90 | return m_Groups.Get(pattern); | 93 | return m_Groups.Get(pattern, new NpgsqlParameter("pattern", pattern)); |
94 | } | ||
91 | } | 95 | } |
92 | 96 | ||
93 | public bool DeleteGroup(UUID groupID) | 97 | public bool DeleteGroup(UUID groupID) |