Index: trunk/tools/wmib/Core.cs |
— | — | @@ -115,6 +115,10 @@ |
116 | 116 | name = name.Replace("|", "\\|"); |
117 | 117 | name = name.Replace("]", "\\]"); |
118 | 118 | name = name.Replace("[", "\\["); |
| 119 | + name = name.Replace("\\", "\\\\"); |
| 120 | + name = name.Replace("^", "\\^"); |
| 121 | + name = name.Replace("{", "\\{"); |
| 122 | + name = name.Replace("}", "\\}"); |
119 | 123 | return name; |
120 | 124 | } |
121 | 125 | |
— | — | @@ -950,6 +954,11 @@ |
951 | 955 | return false; |
952 | 956 | } |
953 | 957 | |
| 958 | + public static bool validFile(string name) |
| 959 | + { |
| 960 | + return !(name.Contains(" ") || name.Contains("?") || name.Contains("|") || name.Contains("/") || name.Contains("\\") || name.Contains(">") || name.Contains("<") || name.Contains("*")); |
| 961 | + } |
| 962 | + |
954 | 963 | /// <summary> |
955 | 964 | /// |
956 | 965 | /// </summary> |
— | — | @@ -968,7 +977,7 @@ |
969 | 978 | if (message.Contains(" ")) |
970 | 979 | { |
971 | 980 | string channel = message.Substring(message.IndexOf(" ") + 1); |
972 | | - if (channel.Contains(" ") || channel.Contains("|") || channel.Contains("/") || (channel.Contains("#") == false)) |
| 981 | + if ( !validFile(channel) || (channel.Contains("#") == false)) |
973 | 982 | { |
974 | 983 | Message("Invalid name", chan.name); |
975 | 984 | return; |