* Properties: Don't play games with \r and \n on load/save,
it was causing fatal issues on DOS if your username started with r or n
This commit is contained in:
@ -280,8 +280,13 @@ public class DataHelper {
|
|||||||
String val = line.substring(split+1); //.trim() ??????????????
|
String val = line.substring(split+1); //.trim() ??????????????
|
||||||
// Unescape line breaks after loading.
|
// Unescape line breaks after loading.
|
||||||
// Remember: "\" needs escaping both for regex and string.
|
// Remember: "\" needs escaping both for regex and string.
|
||||||
val = val.replaceAll("\\\\r","\r");
|
|
||||||
val = val.replaceAll("\\\\n","\n");
|
// For some reason this was turning \r (one backslash) into CR,
|
||||||
|
// I think it needed one more \\ in the pattern?,
|
||||||
|
// which sucks if your username is randy on DOS,
|
||||||
|
// it was a horrible idea anyway
|
||||||
|
//val = val.replaceAll("\\\\r","\r");
|
||||||
|
//val = val.replaceAll("\\\\n","\n");
|
||||||
if ( (key.length() > 0) && (val.length() > 0) )
|
if ( (key.length() > 0) && (val.length() > 0) )
|
||||||
if (forceLowerCase)
|
if (forceLowerCase)
|
||||||
props.setProperty(key.toLowerCase(), val);
|
props.setProperty(key.toLowerCase(), val);
|
||||||
|
@ -1053,8 +1053,9 @@ public class Router {
|
|||||||
String val = _config.getProperty(key);
|
String val = _config.getProperty(key);
|
||||||
// Escape line breaks before saving.
|
// Escape line breaks before saving.
|
||||||
// Remember: "\" needs escaping both for regex and string.
|
// Remember: "\" needs escaping both for regex and string.
|
||||||
val = val.replaceAll("\\r","\\\\r");
|
// NOOO - see comments in DataHelper
|
||||||
val = val.replaceAll("\\n","\\\\n");
|
//val = val.replaceAll("\\r","\\\\r");
|
||||||
|
//val = val.replaceAll("\\n","\\\\n");
|
||||||
buf.append(key).append('=').append(val).append('\n');
|
buf.append(key).append('=').append(val).append('\n');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user