summaryrefslogtreecommitdiff
path: root/src/configreader.cpp
diff options
context:
space:
mode:
authorGravatar brain2006-12-17 00:35:05 +0000
committerGravatar brain2006-12-17 00:35:05 +0000
commitebb892cdfd85ad40f5fa130c43bda0ed55a98c56 (patch)
treef433fc0df29441213945a1124c7cb46438d52bd2 /src/configreader.cpp
parentFinally document <insane> tag, we've had this since like 1.0 beta 6, but we n... (diff)
If the caller said no linefeeds, dont bail, instead just turn the linefeeds into spaces, so that
"aaaa bbbb" becomes "aaaa bbbb". git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6022 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/configreader.cpp')
-rw-r--r--src/configreader.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp
index 682dbeb38..144c0f0a8 100644
--- a/src/configreader.cpp
+++ b/src/configreader.cpp
@@ -1300,18 +1300,21 @@ bool ServerConfig::ConfValue(ConfigDataHash &target, const std::string &tag, con
ConfigDataHash::size_type pos = index;
if((pos >= 0) && (pos < target.count(tag)))
{
- ConfigDataHash::const_iterator iter = target.find(tag);
+ ConfigDataHash::iterator iter = target.find(tag);
for(int i = 0; i < index; i++)
iter++;
- for(KeyValList::const_iterator j = iter->second.begin(); j != iter->second.end(); j++)
+ for(KeyValList::iterator j = iter->second.begin(); j != iter->second.end(); j++)
{
if(j->first == var)
{
if ((!allow_linefeeds) && (j->second.find('\n') != std::string::npos))
{
- throw CoreException("Value of <" + tag + ":" + var+ "> contains a linefeed, and linefeeds in this value are not permitted");
+ ServerInstance->Log(DEFAULT, "Value of <" + tag + ":" + var+ "> contains a linefeed, and linefeeds in this value are not permitted -- stripped to spaces.");
+ for (std::string::iterator n = j->second.begin(); n != j->second.end(); n++)
+ if (*n == '\n')
+ *n == ' ';
}
else
{