mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-01-19 15:03:36 +08:00
[RegistryPreview]Accept more valid formats for the root keys (#31552)
* Added validation for HKEY path root abbreviations * Added abbreviations
This commit is contained in:
parent
38e34aa615
commit
a36e119204
@ -1192,7 +1192,19 @@ namespace RegistryPreview
|
||||
key.StartsWith(@"[HKEY_CURRENT_USER\", StringComparison.InvariantCultureIgnoreCase) == false &&
|
||||
key.StartsWith(@"[HKEY_USERS\", StringComparison.InvariantCultureIgnoreCase) == false &&
|
||||
key.StartsWith(@"[HKEY_LOCAL_MACHINE\", StringComparison.InvariantCultureIgnoreCase) == false &&
|
||||
key.StartsWith(@"[HKEY_CURRENT_CONFIG\", StringComparison.InvariantCultureIgnoreCase) == false))
|
||||
key.StartsWith(@"[HKEY_CURRENT_CONFIG\", StringComparison.InvariantCultureIgnoreCase) == false)
|
||||
&&
|
||||
(key.StartsWith("[HKCR]", StringComparison.InvariantCultureIgnoreCase) == false &&
|
||||
key.StartsWith("[HKCU]", StringComparison.InvariantCultureIgnoreCase) == false &&
|
||||
key.StartsWith("[HKU]", StringComparison.InvariantCultureIgnoreCase) == false &&
|
||||
key.StartsWith("[HKLM]", StringComparison.InvariantCultureIgnoreCase) == false &&
|
||||
key.StartsWith("[HKCC]", StringComparison.InvariantCultureIgnoreCase) == false)
|
||||
&&
|
||||
(key.StartsWith(@"[HKCR\", StringComparison.InvariantCultureIgnoreCase) == false &&
|
||||
key.StartsWith(@"[HKCU\", StringComparison.InvariantCultureIgnoreCase) == false &&
|
||||
key.StartsWith(@"[HKU\", StringComparison.InvariantCultureIgnoreCase) == false &&
|
||||
key.StartsWith(@"[HKLM\", StringComparison.InvariantCultureIgnoreCase) == false &&
|
||||
key.StartsWith(@"[HKCC\", StringComparison.InvariantCultureIgnoreCase) == false))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user