Imported Upstream version 5.4.0.167

Former-commit-id: 5624ac747d633e885131e8349322922b6a59baaa
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-08-21 15:34:15 +00:00
parent e49d6f06c0
commit 536cd135cc
12856 changed files with 563812 additions and 223249 deletions

View File

@ -158,7 +158,7 @@ namespace System.Web.Util {
Hashtable values = new Hashtable(param.Length);
for (int i = param.Length - 1; i >= 0; i--) {
SecUtility.CheckParameter(ref param[i], checkForNull, checkIfEmpty, checkForCommas, maxSize,
SecUtility.CheckParameter(ref param[i], checkForNull, checkIfEmpty, checkForCommas, maxSize,
paramName + "[ " + i.ToString(CultureInfo.InvariantCulture) + " ]");
if (values.Contains(param[i])) {
throw new ArgumentException(SR.GetString(SR.Parameter_duplicate_array_element, paramName), paramName);
@ -215,6 +215,17 @@ namespace System.Web.Util {
return iValue;
}
internal static TimeUnit GetTimeoutUnit(NameValueCollection config, string valueName, TimeUnit defaultValue) {
TimeUnit unit;
string sValue = config[valueName];
if (sValue == null || !Enum.TryParse(sValue, out unit)) {
return defaultValue;
}
return unit;
}
internal static int? GetNullableIntValue(NameValueCollection config, string valueName) {
int iValue;
string sValue = config[valueName];