* Console:

- Fix update buttons
   - Don't filter parameter names starting with "nofilter_"
   - Re-allow configadvanced, news URL, and unsigned update URL if routerconsole.advanced=true
   - Re-allow plugin install if routerconsole.advanced=true or routerconsole.enablePluginInstall=true
   - Only allow whitelisted plugin signers, unless routerconsole.allowUntrustedPlugins=true
   - Re-allow clients.config changes if routerconsole.advanced=true or routerconsole.enableClientChange=true
   - More escaping
 * i2psnark: Fix add torrent form
This commit is contained in:
zzz
2014-08-03 13:58:51 +00:00
parent bf9c4b2346
commit b28eb708a4
26 changed files with 289 additions and 131 deletions

View File

@ -241,7 +241,20 @@ public class SnarkManager implements CompleteListener {
private static final int MAX_MESSAGES = 100;
/**
* Use if it does not include a link.
* Escapes '<' and '>' before queueing
*/
public void addMessage(String message) {
addMessageNoEscape(message.replace("<", "&lt;").replace(">", "&gt;"));
}
/**
* Use if it includes a link.
* Does not escape '<' and '>' before queueing
* @since 0.9.14.1
*/
public void addMessageNoEscape(String message) {
_messages.offer(message);
while (_messages.size() > MAX_MESSAGES) {
_messages.poll();
@ -579,7 +592,7 @@ public class SnarkManager implements CompleteListener {
}
if (dataDir != null && !dataDir.equals(getDataDir().getAbsolutePath())) {
dataDir = dataDir.trim();
dataDir = DataHelper.stripHTML(dataDir.trim());
File dd = new File(dataDir);
if (!dd.isAbsolute()) {
addMessage(_("Data directory must be an absolute path") + ": " + dataDir);
@ -609,7 +622,7 @@ public class SnarkManager implements CompleteListener {
}
Map<String, String> opts = new HashMap<String, String>();
if (i2cpOpts == null) i2cpOpts = "";
i2cpOpts = DataHelper.stripHTML(i2cpOpts);
StringTokenizer tok = new StringTokenizer(i2cpOpts, " \t\n");
while (tok.hasMoreTokens()) {
String pair = tok.nextToken();