refine UserPAC setting

pull/695/head
YFdyh000 5 years ago
parent f48468029e
commit 5b3f09aaf7

@ -373,7 +373,7 @@ namespace v2rayN.Forms
private int SaveUserPAC() private int SaveUserPAC()
{ {
string userPacRule = txtuserPacRule.Text.TrimEx(); string userPacRule = txtuserPacRule.Text.TrimEx();
userPacRule = userPacRule.Replace("\"", ""); userPacRule = userPacRule.Replace("\"", "").Replace("'", "");
config.userPacRule = Utils.String2List(userPacRule); config.userPacRule = Utils.String2List(userPacRule);

@ -282,7 +282,7 @@
<value>协议</value> <value>协议</value>
</data> </data>
<data name="label4.Text" xml:space="preserve"> <data name="label4.Text" xml:space="preserve">
<value>*设置用户PAC规则用逗号(,)隔开</value> <value>*用户PAC内的自定条目。用逗号(,)或换行隔开的匹配模式pattern。英文单引号、双引号将被忽略。</value>
</data> </data>
<data name="label5.Size" type="System.Drawing.Size, System.Drawing"> <data name="label5.Size" type="System.Drawing.Size, System.Drawing">
<value>53, 12</value> <value>53, 12</value>

@ -168,7 +168,7 @@ namespace v2rayN
} }
} }
/// <summary> /// <summary>
/// 逗号分隔的字符串,转List<string> /// 换行或逗号分隔的字符串,转List<string>
/// </summary> /// </summary>
/// <param name="str"></param> /// <param name="str"></param>
/// <returns></returns> /// <returns></returns>
@ -176,7 +176,7 @@ namespace v2rayN
{ {
try try
{ {
str = str.Replace(Environment.NewLine, ""); str = str.Replace("\r", ",").Replace("\n", ","); // 用户复制的可能是\r、\n或\r\n
return new List<string>(str.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries)); return new List<string>(str.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries));
} }
catch catch

Loading…
Cancel
Save