File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed
src/ICSharpCode.SharpZipLib/Zip Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -138,18 +138,22 @@ public bool CanDecompressEntry
138
138
/// <summary>
139
139
/// Is the compression method for the specified entry supported?
140
140
/// </summary>
141
- /// <remarks>
142
- /// Uses entry.CompressionMethodForHeader so that entries of type WinZipAES will be rejected.
143
- /// </remarks>
144
141
/// <param name="entry">the entry to check.</param>
145
142
/// <returns>true if the compression methiod is supported, false if not.</returns>
146
143
private static bool IsEntryCompressionMethodSupported ( ZipEntry entry )
147
144
{
148
- var entryCompressionMethod = entry . CompressionMethodForHeader ;
149
-
150
- return entryCompressionMethod == CompressionMethod . Deflated ||
151
- entryCompressionMethod == CompressionMethod . Stored ||
152
- entryCompressionMethod == CompressionMethod . WinZipAES ;
145
+ var entryCompressionMethodForHeader = entry . CompressionMethodForHeader ;
146
+ var entryCompressionMethod = entry . CompressionMethod ;
147
+
148
+ var compressionMethodSupported =
149
+ entryCompressionMethod == CompressionMethod . Deflated ||
150
+ entryCompressionMethod == CompressionMethod . Stored ;
151
+ var entryCompressionMethodForHeaderSupported =
152
+ entryCompressionMethodForHeader == CompressionMethod . Deflated ||
153
+ entryCompressionMethodForHeader == CompressionMethod . Stored ||
154
+ entryCompressionMethodForHeader == CompressionMethod . WinZipAES ;
155
+
156
+ return compressionMethodSupported && entryCompressionMethodForHeaderSupported ;
153
157
}
154
158
155
159
/// <summary>
You can’t perform that action at this time.
0 commit comments