Explorar el Código

Added parsing of location to remove bad characters

tags/3.1.0
Teknikode hace 4 años
padre
commit
36b79ba801
Se han modificado 2 ficheros con 5 adiciones y 2 borrados
  1. 4
    1
      Modules/Logging/Logging.cs
  2. 1
    1
      Modules/Logging/Module.Default.json

+ 4
- 1
Modules/Logging/Logging.cs Ver fichero

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Security.AccessControl;
using System.Text.RegularExpressions;
using System.Threading;
using Combot.Databases;
using Combot.IRCServices.Messaging;
@@ -181,7 +182,9 @@ namespace Combot.Modules.Plugins
if (doLog)
{
logLock.EnterWriteLock();
string logDir = Path.Combine(GetOptionValue("Log Path").ToString(), Bot.ServerConfig.Name, location);
string pattern = "[^a-zA-Z0-9-_.+#]"; //regex pattern
string parsedLocation = Regex.Replace(location, pattern, "_");
string logDir = Path.Combine(GetOptionValue("Log Path").ToString(), Bot.ServerConfig.Name, parsedLocation);
if (!Directory.Exists(logDir))
Directory.CreateDirectory(logDir);


+ 1
- 1
Modules/Logging/Module.Default.json Ver fichero

@@ -13,7 +13,7 @@
},
{
"Name": "Max Log Size",
"Description": "The maximum log size before it rolls to a new file (in KB)",
"Description": "The maximum log size before it rolls to a new file (in Bytes)",
"Value": 400000
},
{

Cargando…
Cancelar
Guardar