Fix #4121: avoid nested square bracket issue.
This commit is contained in:
parent
07f367a2a5
commit
5954fb91be
|
@ -93,6 +93,7 @@ namespace Oqtane.Infrastructure
|
||||||
}
|
}
|
||||||
|
|
||||||
var result = new StringBuilder();
|
var result = new StringBuilder();
|
||||||
|
source = source.Replace("[[", "[$_["); //avoid nested square bracket issue.
|
||||||
foreach (Match match in this.TokenizerRegex.Matches(source))
|
foreach (Match match in this.TokenizerRegex.Matches(source))
|
||||||
{
|
{
|
||||||
var key = match.Result("${key}");
|
var key = match.Result("${key}");
|
||||||
|
@ -126,7 +127,7 @@ namespace Oqtane.Infrastructure
|
||||||
result.Append(match.Result("${text}"));
|
result.Append(match.Result("${text}"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
result.Replace("[$_", "["); //restore the changes.
|
||||||
return result.ToString();
|
return result.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user