From bbeef89b578869eb84c18138b23b554ef7f7fd22 Mon Sep 17 00:00:00 2001 From: starfighter83 Date: Fri, 26 Mar 2010 12:46:17 +0000 Subject: [PATCH] Fixing 25454: Exporting translation could end up in infinite loop [TFS Changeset #65013] --- umbraco/cms/businesslogic/translation/Translation.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/umbraco/cms/businesslogic/translation/Translation.cs b/umbraco/cms/businesslogic/translation/Translation.cs index 71c1d167aa..7e5f3ad22b 100644 --- a/umbraco/cms/businesslogic/translation/Translation.cs +++ b/umbraco/cms/businesslogic/translation/Translation.cs @@ -112,10 +112,8 @@ namespace umbraco.cms.businesslogic.translation tmpStr = tmpStr.Replace("\n", " "); tmpStr = tmpStr.Replace("\r", " "); - while (tmpStr.IndexOf(" ") != -1) - tmpStr = tmpStr.Replace(" ", " "); - - return tmpStr.Split(' ').Length; + MatchCollection collection = Regex.Matches(tmpStr, @"[\S]+"); + return collection.Count; } } } \ No newline at end of file