diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-11-13 22:44:54 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-11-13 22:44:54 -0500 |
| commit | 635c8d50a361dc2eabbeea0ae55048d1e9f4ad8f (patch) | |
| tree | ebcf01208a34c24215416bdae32e66eab1438e6a /Emby.Server.Implementations/Security | |
| parent | 0e9cd51f9c64d4cfad5cb5c7b0ddae6af8d18ac6 (diff) | |
update character escaping
Diffstat (limited to 'Emby.Server.Implementations/Security')
| -rw-r--r-- | Emby.Server.Implementations/Security/MBLicenseFile.cs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Emby.Server.Implementations/Security/MBLicenseFile.cs b/Emby.Server.Implementations/Security/MBLicenseFile.cs index 4b6a82b6c..76741bdf8 100644 --- a/Emby.Server.Implementations/Security/MBLicenseFile.cs +++ b/Emby.Server.Implementations/Security/MBLicenseFile.cs @@ -57,9 +57,14 @@ namespace Emby.Server.Implementations.Security _updateRecords.AddOrUpdate(key, value, (k, v) => value); } + private Guid GetKey(string featureId) + { + return new Guid(_cryptographyProvider.ComputeMD5(Encoding.Unicode.GetBytes(featureId))); + } + public void AddRegCheck(string featureId) { - var key = new Guid(_cryptographyProvider.ComputeMD5(Encoding.Unicode.GetBytes(featureId))); + var key = GetKey(featureId); var value = DateTime.UtcNow; SetUpdateRecord(key, value); @@ -68,7 +73,7 @@ namespace Emby.Server.Implementations.Security public void RemoveRegCheck(string featureId) { - var key = new Guid(_cryptographyProvider.ComputeMD5(Encoding.Unicode.GetBytes(featureId))); + var key = GetKey(featureId); DateTime val; _updateRecords.TryRemove(key, out val); @@ -78,8 +83,9 @@ namespace Emby.Server.Implementations.Security public DateTime LastChecked(string featureId) { + var key = GetKey(featureId); DateTime last; - _updateRecords.TryGetValue(new Guid(_cryptographyProvider.ComputeMD5(Encoding.Unicode.GetBytes(featureId))), out last); + _updateRecords.TryGetValue(key, out last); // guard agains people just putting a large number in the file return last < DateTime.UtcNow ? last : DateTime.MinValue; |
