Commit 0ec51217 by Urvil Shah

Prevent Wrapping the Same Url Wrap all the time

parent e908684d
Pipeline #7519 passed with stages
in 22 minutes 19 seconds
...@@ -160,7 +160,7 @@ namespace Mobile.Search.Web.Controllers ...@@ -160,7 +160,7 @@ namespace Mobile.Search.Web.Controllers
if (!isSendEmail) if (!isSendEmail)
WrapUrl = true; WrapUrl = true;
HashSet<string> UrlWrap = new HashSet<string>();
while (m.Success && WrapUrl) while (m.Success && WrapUrl)
{ {
count=count-1; count=count-1;
...@@ -171,14 +171,15 @@ namespace Mobile.Search.Web.Controllers ...@@ -171,14 +171,15 @@ namespace Mobile.Search.Web.Controllers
{ {
to_replace= String.Format("{{{{WrapAdvertiserUnsubscribeUrl('{0}')}}}}", m.Groups[1]); to_replace= String.Format("{{{{WrapAdvertiserUnsubscribeUrl('{0}')}}}}", m.Groups[1]);
} }
if(m.Groups[1].Value.Count()>0 && !m.Groups[1].Value.Contains("anchor")) if(m.Groups[1].Value.Count()>0 && !m.Groups[1].Value.Contains("anchor") && !UrlWrap.Contains(m.Groups[1].Value))
{ {
value = value.Replace(m.Groups[1].Value, to_replace); value = value.Replace(m.Groups[1].Value, to_replace);
UrlWrap.Add(m.Groups[1].Value);
} }
} }
m = m.NextMatch(); m = m.NextMatch();
} }
var d = new Dictionary<string, object> var d = new Dictionary<string, object>
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment