* replaceAll() -> replace() when not using regex
* ampersand escaping (lots more to do)
This commit is contained in:
@ -142,7 +142,7 @@ public class ConfigUpdateHandler extends FormHandler {
|
||||
}
|
||||
|
||||
if ( (_updateURL != null) && (_updateURL.length() > 0) ) {
|
||||
_updateURL = _updateURL.replaceAll("\r\n", ",").replaceAll("\n", ",");
|
||||
_updateURL = _updateURL.replace("\r\n", ",").replace("\n", ",");
|
||||
String oldURL = _context.router().getConfigSetting(PROP_UPDATE_URL);
|
||||
if ( (oldURL == null) || (!_updateURL.equals(oldURL)) ) {
|
||||
_context.router().setConfigSetting(PROP_UPDATE_URL, _updateURL);
|
||||
@ -151,7 +151,7 @@ public class ConfigUpdateHandler extends FormHandler {
|
||||
}
|
||||
|
||||
if ( (_trustedKeys != null) && (_trustedKeys.length() > 0) ) {
|
||||
_trustedKeys = _trustedKeys.replaceAll("\r\n", ",").replaceAll("\n", ",");
|
||||
_trustedKeys = _trustedKeys.replace("\r\n", ",").replace("\n", ",");
|
||||
String oldKeys = new TrustedUpdate(_context).getTrustedKeysString();
|
||||
if ( (oldKeys == null) || (!_trustedKeys.equals(oldKeys)) ) {
|
||||
_context.router().setConfigSetting(PROP_TRUSTED_KEYS, _trustedKeys);
|
||||
|
@ -40,7 +40,7 @@ public class ConfigUpdateHelper extends HelperBase {
|
||||
public String getUpdateURL() {
|
||||
String url = _context.getProperty(ConfigUpdateHandler.PROP_UPDATE_URL);
|
||||
if (url != null)
|
||||
return url.replaceAll(",", "\n");
|
||||
return url.replace(",", "\n");
|
||||
else
|
||||
return ConfigUpdateHandler.DEFAULT_UPDATE_URL;
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ public class LogsHelper extends HelperBase {
|
||||
if (str == null)
|
||||
return "";
|
||||
else {
|
||||
str = str.replaceAll("<", "<").replaceAll(">", ">");
|
||||
str = str.replace("&", "&").replace("<", "<").replace(">", ">");
|
||||
return _("File location") + ": <b><code>" + f.getAbsolutePath() + "</code></b> <pre>" + str + "</pre>";
|
||||
}
|
||||
}
|
||||
@ -54,12 +54,14 @@ public class LogsHelper extends HelperBase {
|
||||
buf.append("<code>\n");
|
||||
for (int i = msgs.size(); i > 0; i--) {
|
||||
String msg = msgs.get(i - 1);
|
||||
msg = msg.replace("&", "&").replace("<", "<").replace(">", ">");
|
||||
buf.append("<li>");
|
||||
if (colorize) {
|
||||
String color;
|
||||
// Homeland Security Advisory System
|
||||
// http://www.dhs.gov/xinfoshare/programs/Copy_of_press_release_0046.shtm
|
||||
// but pink instead of yellow for WARN
|
||||
// FIXME doesnt work for translated levels
|
||||
if (msg.contains("CRIT"))
|
||||
color = "#cc0000";
|
||||
else if (msg.contains("ERROR"))
|
||||
@ -71,7 +73,7 @@ public class LogsHelper extends HelperBase {
|
||||
else
|
||||
color = "#006600";
|
||||
buf.append("<font color=\"").append(color).append("\">");
|
||||
buf.append(msg.replaceAll("<", "<").replaceAll(">", ">"));
|
||||
buf.append(msg);
|
||||
buf.append("</font>");
|
||||
} else {
|
||||
buf.append(msg);
|
||||
|
Reference in New Issue
Block a user