mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-07-17 03:40:06 +08:00
Merge branch 'feature/6688_RequestTokens_Chaintext' into Laser/1.10.x
This commit is contained in:
commit
578b21b75e
@ -129,12 +129,12 @@ namespace Orchard.Tokens.Providers {
|
|||||||
chainIndex = token.IndexOf(").") + 1;
|
chainIndex = token.IndexOf(").") + 1;
|
||||||
tokenLength = (tokenPrefix + ":").Length;
|
tokenLength = (tokenPrefix + ":").Length;
|
||||||
if (chainIndex == 0) {// ")." has not be found
|
if (chainIndex == 0) {// ")." has not be found
|
||||||
return Regex.Replace(token.Substring(tokenLength), @"[\(|\)]", "");
|
return token.Substring(tokenLength).Trim(new char[] { '(', ')' });
|
||||||
}
|
}
|
||||||
if (!token.StartsWith((tokenPrefix + ":"), StringComparison.OrdinalIgnoreCase) || chainIndex <= tokenLength) {
|
if (!token.StartsWith((tokenPrefix + ":"), StringComparison.OrdinalIgnoreCase) || chainIndex <= tokenLength) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return Regex.Replace(token.Substring(tokenLength, chainIndex - tokenLength), @"[\(|\)]", "");
|
return token.Substring(tokenLength, chainIndex - tokenLength).Trim(new char[] { '(', ')' });
|
||||||
}
|
}
|
||||||
private static Tuple<string, string> FilterChainParam(string token) {
|
private static Tuple<string, string> FilterChainParam(string token) {
|
||||||
string tokenPrefix;
|
string tokenPrefix;
|
||||||
@ -152,12 +152,12 @@ namespace Orchard.Tokens.Providers {
|
|||||||
chainIndex = token.IndexOf(").") + 1;
|
chainIndex = token.IndexOf(").") + 1;
|
||||||
tokenLength = (tokenPrefix + ":").Length;
|
tokenLength = (tokenPrefix + ":").Length;
|
||||||
if (chainIndex == 0) { // ")." has not be found
|
if (chainIndex == 0) { // ")." has not be found
|
||||||
return new Tuple<string, string>(Regex.Replace(token.Substring(tokenLength), @"[\(|\)]", ""), token.Length.ToString());
|
return new Tuple<string, string>(token.Substring(tokenLength).Trim(new char[] { '(', ')' }), token.Length.ToString());
|
||||||
}
|
}
|
||||||
if (!token.StartsWith((tokenPrefix + ":"), StringComparison.OrdinalIgnoreCase) || chainIndex <= tokenLength) {
|
if (!token.StartsWith((tokenPrefix + ":"), StringComparison.OrdinalIgnoreCase) || chainIndex <= tokenLength) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return new Tuple<string, string>(Regex.Replace(token.Substring(tokenLength, chainIndex - tokenLength), @"[\(|\)]", ""), token.Substring(chainIndex + 1));
|
return new Tuple<string, string>(token.Substring(tokenLength, chainIndex - tokenLength).Trim(new char[] { '(', ')' }), token.Substring(chainIndex + 1));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user