aboutsummaryrefslogtreecommitdiffstats
path: root/infrastructure
diff options
context:
space:
mode:
authorChris Ball <cjb@laptop.org>2010-04-05 13:09:29 -0400
committerChris Ball <cjb@laptop.org>2010-04-05 13:09:29 -0400
commitdc553ec9c0a172c51a69ce2fe9599c1123d493ba (patch)
tree7812a71d45caf8d629aa4856e7fab6985c025e3f /infrastructure
parent6d5f97d67df88ba77cb38f62c08dcba9fe306f87 (diff)
downloadetherpad-dc553ec9c0a172c51a69ce2fe9599c1123d493ba.tar.gz
etherpad-dc553ec9c0a172c51a69ce2fe9599c1123d493ba.tar.xz
etherpad-dc553ec9c0a172c51a69ce2fe9599c1123d493ba.zip
Make config parsing more robust
Previously, config booleans like etherpad.isProduction accepted only "true", and not "true " or " true" or "True" or "TRUE". Fix that.
Diffstat (limited to 'infrastructure')
-rw-r--r--infrastructure/net.appjet.oui/config.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/infrastructure/net.appjet.oui/config.scala b/infrastructure/net.appjet.oui/config.scala
index 46e73cf..6201816 100644
--- a/infrastructure/net.appjet.oui/config.scala
+++ b/infrastructure/net.appjet.oui/config.scala
@@ -41,7 +41,7 @@ object config {
null;
}
}
- def boolOrElse(name: String, default: Boolean) = values.get(name).map(_.equals("true")).getOrElse(default);
+ def boolOrElse(name: String, default: Boolean) = values.get(name).map(_.matches("(?i)\\s*true\\s*")).getOrElse(default);
def intOrElse(name: String, default: Int) = values.get(name).map(Integer.parseInt(_)).getOrElse(default);
def longOrElse(name: String, default: Long) = values.get(name).map(java.lang.Long.parseLong(_)).getOrElse(default);