fix illegal characters bug when reading Settings.txt with LF line endings

--HG--
branch : 1.x
extra : transplant_source : %EE%25%C4%22%FBL%D9%8E%8A%E8%C7%25%A8x%27A%B7%D4%06%D2
This commit is contained in:
Ben Keeping
2011-08-12 15:48:26 +01:00
parent a1b0ce3909
commit c54df43b9a

View File

@@ -54,8 +54,11 @@ namespace Orchard.Environment.Configuration {
if (String.IsNullOrEmpty(text))
return shellSettings;
var settings = text.Split(new[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
foreach (var setting in settings) {
var settings = new StringReader(text);
string setting;
while ((setting = settings.ReadLine()) != null)
{
if (string.IsNullOrWhiteSpace(setting)) continue; ;
var separatorIndex = setting.IndexOf(Separator);
if (separatorIndex == -1)
{