{"action":"created","comment":{"url":"https://api.github.com/repos/umbraco/Umbraco-CMS/pulls/comments/68005473","id":68005473,"diff_hunk":"@@ -152,47 +151,46 @@ public IEnumerable<byte[]> ReadFilesFromArchive(string packageFilePath, IEnumera\n \r\n             using (var fs = File.OpenRead(packageFilePath))\r\n             {\r\n-                using (var zipInputStream = new ZipInputStream(fs))\r\n+                using (var zipArchive = new ZipArchive(fs))\r\n                 {\r\n-                    ZipEntry zipEntry;\r\n-                    while ((zipEntry = zipInputStream.GetNextEntry()) != null)\r\n+                    foreach(var zipEntry in zipArchive.Entries)\r\n                     {\r\n-                        \r\n-                        if (zipEntry.IsDirectory) continue;\r\n-\r\n                         if (files.Contains(zipEntry.Name))\r\n                         {\r\n                             using (var memStream = new MemoryStream())\r\n                             {\r\n-                                zipInputStream.CopyTo(memStream);\r\n+                                var zippedFile = zipEntry.Open();\r\n+                                zippedFile.CopyTo(memStream);\r\n                                 yield return memStream.ToArray();\r\n                                 memStream.Close();\r\n                             }\r\n                         }\r\n                     }\r\n-\r\n-                    zipInputStream.Close();\r\n+                    \r\n                 }\r\n                 fs.Close();\r\n             }\r\n         }\r\n \r\n-        private void ReadZipfileEntries(string packageFilePath, Func<ZipEntry, ZipInputStream, bool> entryFunc, bool skipsDirectories = true)\r\n+        /// <summary>\r\n+        /// Open a package file, and run entryFunc for every one of these\r\n+        /// </summary>\r\n+        /// <param name=\"packageFilePath\">the file path of the package file</param>\r\n+        /// <param name=\"entryFunc\">The function to perform on every Entry</param>\r\n+        /// <param name=\"skipsDirectories\"></param>\r\n+        private void ReadZipfileEntries(string packageFilePath, Func<ZipArchiveEntry, Stream, bool> entryFunc, bool skipsDirectories = true)\r\n         {\r\n             CheckPackageExists(packageFilePath);\r\n \r\n             using (var fs = File.OpenRead(packageFilePath))\r\n             {\r\n-                using (var zipInputStream = new ZipInputStream(fs))\r\n+                using (var zipArchive = new ZipArchive(fs))\r\n                 {\r\n-                    ZipEntry zipEntry;\r\n-                    while ((zipEntry = zipInputStream.GetNextEntry()) != null)\r\n+                    foreach (var zipEntry in zipArchive.Entries)\r\n                     {\r\n-                        if (zipEntry.IsDirectory && skipsDirectories) continue;\r\n-                        if (entryFunc(zipEntry, zipInputStream) == false) break;\r\n+                        // if (zipEntry.IsDirectory && skipsDirectories) continue;\r\n+                        if (entryFunc(zipEntry, zipEntry.Open()) == false) break;\r","path":"src/Umbraco.Core/Packaging/PackageExtraction.cs","position":77,"original_position":77,"commit_id":"d0c88dfe16962e2656d26745e652256580560f7b","original_commit_id":"d0c88dfe16962e2656d26745e652256580560f7b","user":{"login":"nul800sebastiaan","id":304656,"avatar_url":"https://avatars.githubusercontent.com/u/304656?v=3","gravatar_id":"","url":"https://api.github.com/users/nul800sebastiaan","html_url":"https://github.com/nul800sebastiaan","followers_url":"https://api.github.com/users/nul800sebastiaan/followers","following_url":"https://api.github.com/users/nul800sebastiaan/following{/other_user}","gists_url":"https://api.github.com/users/nul800sebastiaan/gists{/gist_id}","starred_url":"https://api.github.com/users/nul800sebastiaan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nul800sebastiaan/subscriptions","organizations_url":"https://api.github.com/users/nul800sebastiaan/orgs","repos_url":"https://api.github.com/users/nul800sebastiaan/repos","events_url":"https://api.github.com/users/nul800sebastiaan/events{/privacy}","received_events_url":"https://api.github.com/users/nul800sebastiaan/received_events","type":"User","site_admin":false},"body":"Not sure either, would be safest to do:\r\n\r\n```\r\nvar stream = zipEntry.Open();\r\nusing (stream)\r\n{\r\n    if (entryFunc(zipEntry, stream) == false) break;\r\n}\r\n```","created_at":"2016-06-22T07:25:34Z","updated_at":"2016-06-22T07:25:34Z","html_url":"https://github.com/umbraco/Umbraco-CMS/pull/1336#discussion_r68005473","pull_request_url":"https://api.github.com/repos/umbraco/Umbraco-CMS/pulls/1336","_links":{"self":{"href":"https://api.github.com/repos/umbraco/Umbraco-CMS/pulls/comments/68005473"},"html":{"href":"https://github.com/umbraco/Umbraco-CMS/pull/1336#discussion_r68005473"},"pull_request":{"href":"https://api.github.com/repos/umbraco/Umbraco-CMS/pulls/1336"}}},"pull_request":{"url":"https://api.github.com/repos/umbraco/Umbraco-CMS/pulls/1336","id":74348401,"html_url":"https://github.com/umbraco/Umbraco-CMS/pull/1336","diff_url":"https://github.com/umbraco/Umbraco-CMS/pull/1336.diff","patch_url":"https://github.com/umbraco/Umbraco-CMS/pull/1336.patch","issue_url":"https://api.github.com/repos/umbraco/Umbraco-CMS/issues/1336","number":1336,"state":"open","locked":false,"title":"U4-8409 remove ICSharpCode.SharpZipLib dependency from Core project","user":{"login":"dampee","id":1857460,"avatar_url":"https://avatars.githubusercontent.com/u/1857460?v=3","gravatar_id":"","url":"https://api.github.com/users/dampee","html_url":"https://github.com/dampee","followers_url":"https://api.github.com/users/dampee/followers","following_url":"https://api.github.com/users/dampee/following{/other_user}","gists_url":"https://api.github.com/users/dampee/gists{/gist_id}","starred_url":"https://api.github.com/users/dampee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dampee/subscriptions","organizations_url":"https://api.github.com/users/dampee/orgs","repos_url":"https://api.github.com/users/dampee/repos","events_url":"https://api.github.com/users/dampee/events{/privacy}","received_events_url":"https://api.github.com/users/dampee/received_events","type":"User","site_admin":false},"body":"Just some code.  Untested currently.","created_at":"2016-06-18T21:58:15Z","updated_at":"2016-06-22T07:25:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b8ea46ee7518a35158ddcd9b6ab3154f2b1cf5c3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/umbraco/Umbraco-CMS/pulls/1336/commits","review_comments_url":"https://api.github.com/repos/umbraco/Umbraco-CMS/pulls/1336/comments","review_comment_url":"https://api.github.com/repos/umbraco/Umbraco-CMS/pulls/comments{/number}","comments_url":"https://api.github.com/repos/umbraco/Umbraco-CMS/issues/1336/comments","statuses_url":"https://api.github.com/repos/umbraco/Umbraco-CMS/statuses/d0c88dfe16962e2656d26745e652256580560f7b","head":{"label":"dampee:U4-8409-v8","ref":"U4-8409-v8","sha":"d0c88dfe16962e2656d26745e652256580560f7b","user":{"login":"dampee","id":1857460,"avatar_url":"https://avatars.githubusercontent.com/u/1857460?v=3","gravatar_id":"","url":"https://api.github.com/users/dampee","html_url":"https://github.com/dampee","followers_url":"https://api.github.com/users/dampee/followers","following_url":"https://api.github.com/users/dampee/following{/other_user}","gists_url":"https://api.github.com/users/dampee/gists{/gist_id}","starred_url":"https://api.github.com/users/dampee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dampee/subscriptions","organizations_url":"https://api.github.com/users/dampee/orgs","repos_url":"https://api.github.com/users/dampee/repos","events_url":"https://api.github.com/users/dampee/events{/privacy}","received_events_url":"https://api.github.com/users/dampee/received_events","type":"User","site_admin":false},"repo":{"id":12186433,"name":"Umbraco-CMS","full_name":"dampee/Umbraco-CMS","owner":{"login":"dampee","id":1857460,"avatar_url":"https://avatars.githubusercontent.com/u/1857460?v=3","gravatar_id":"","url":"https://api.github.com/users/dampee","html_url":"https://github.com/dampee","followers_url":"https://api.github.com/users/dampee/followers","following_url":"https://api.github.com/users/dampee/following{/other_user}","gists_url":"https://api.github.com/users/dampee/gists{/gist_id}","starred_url":"https://api.github.com/users/dampee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dampee/subscriptions","organizations_url":"https://api.github.com/users/dampee/orgs","repos_url":"https://api.github.com/users/dampee/repos","events_url":"https://api.github.com/users/dampee/events{/privacy}","received_events_url":"https://api.github.com/users/dampee/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dampee/Umbraco-CMS","description":"The simple, flexible and friendly ASP.NET CMS used by more than 175.000 websites","fork":true,"url":"https://api.github.com/repos/dampee/Umbraco-CMS","forks_url":"https://api.github.com/repos/dampee/Umbraco-CMS/forks","keys_url":"https://api.github.com/repos/dampee/Umbraco-CMS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dampee/Umbraco-CMS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dampee/Umbraco-CMS/teams","hooks_url":"https://api.github.com/repos/dampee/Umbraco-CMS/hooks","issue_events_url":"https://api.github.com/repos/dampee/Umbraco-CMS/issues/events{/number}","events_url":"https://api.github.com/repos/dampee/Umbraco-CMS/events","assignees_url":"https://api.github.com/repos/dampee/Umbraco-CMS/assignees{/user}","branches_url":"https://api.github.com/repos/dampee/Umbraco-CMS/branches{/branch}","tags_url":"https://api.github.com/repos/dampee/Umbraco-CMS/tags","blobs_url":"https://api.github.com/repos/dampee/Umbraco-CMS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dampee/Umbraco-CMS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dampee/Umbraco-CMS/git/refs{/sha}","trees_url":"https://api.github.com/repos/dampee/Umbraco-CMS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dampee/Umbraco-CMS/statuses/{sha}","languages_url":"https://api.github.com/repos/dampee/Umbraco-CMS/languages","stargazers_url":"https://api.github.com/repos/dampee/Umbraco-CMS/stargazers","contributors_url":"https://api.github.com/repos/dampee/Umbraco-CMS/contributors","subscribers_url":"https://api.github.com/repos/dampee/Umbraco-CMS/subscribers","subscription_url":"https://api.github.com/repos/dampee/Umbraco-CMS/subscription","commits_url":"https://api.github.com/repos/dampee/Umbraco-CMS/commits{/sha}","git_commits_url":"https://api.github.com/repos/dampee/Umbraco-CMS/git/commits{/sha}","comments_url":"https://api.github.com/repos/dampee/Umbraco-CMS/comments{/number}","issue_comment_url":"https://api.github.com/repos/dampee/Umbraco-CMS/issues/comments{/number}","contents_url":"https://api.github.com/repos/dampee/Umbraco-CMS/contents/{+path}","compare_url":"https://api.github.com/repos/dampee/Umbraco-CMS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dampee/Umbraco-CMS/merges","archive_url":"https://api.github.com/repos/dampee/Umbraco-CMS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dampee/Umbraco-CMS/downloads","issues_url":"https://api.github.com/repos/dampee/Umbraco-CMS/issues{/number}","pulls_url":"https://api.github.com/repos/dampee/Umbraco-CMS/pulls{/number}","milestones_url":"https://api.github.com/repos/dampee/Umbraco-CMS/milestones{/number}","notifications_url":"https://api.github.com/repos/dampee/Umbraco-CMS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dampee/Umbraco-CMS/labels{/name}","releases_url":"https://api.github.com/repos/dampee/Umbraco-CMS/releases{/id}","deployments_url":"https://api.github.com/repos/dampee/Umbraco-CMS/deployments","created_at":"2013-08-17T22:02:45Z","updated_at":"2014-05-13T20:32:02Z","pushed_at":"2016-06-19T07:41:35Z","git_url":"git://github.com/dampee/Umbraco-CMS.git","ssh_url":"git@github.com:dampee/Umbraco-CMS.git","clone_url":"https://github.com/dampee/Umbraco-CMS.git","svn_url":"https://github.com/dampee/Umbraco-CMS","homepage":"http://umbraco.com","size":120465,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"6.1.4"}},"base":{"label":"umbraco:dev-v8","ref":"dev-v8","sha":"9959d58fbcdbb0eaf9a79c4c51b859afbfdec58e","user":{"login":"umbraco","id":1419552,"avatar_url":"https://avatars.githubusercontent.com/u/1419552?v=3","gravatar_id":"","url":"https://api.github.com/users/umbraco","html_url":"https://github.com/umbraco","followers_url":"https://api.github.com/users/umbraco/followers","following_url":"https://api.github.com/users/umbraco/following{/other_user}","gists_url":"https://api.github.com/users/umbraco/gists{/gist_id}","starred_url":"https://api.github.com/users/umbraco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/umbraco/subscriptions","organizations_url":"https://api.github.com/users/umbraco/orgs","repos_url":"https://api.github.com/users/umbraco/repos","events_url":"https://api.github.com/users/umbraco/events{/privacy}","received_events_url":"https://api.github.com/users/umbraco/received_events","type":"Organization","site_admin":false},"repo":{"id":10601208,"name":"Umbraco-CMS","full_name":"umbraco/Umbraco-CMS","owner":{"login":"umbraco","id":1419552,"avatar_url":"https://avatars.githubusercontent.com/u/1419552?v=3","gravatar_id":"","url":"https://api.github.com/users/umbraco","html_url":"https://github.com/umbraco","followers_url":"https://api.github.com/users/umbraco/followers","following_url":"https://api.github.com/users/umbraco/following{/other_user}","gists_url":"https://api.github.com/users/umbraco/gists{/gist_id}","starred_url":"https://api.github.com/users/umbraco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/umbraco/subscriptions","organizations_url":"https://api.github.com/users/umbraco/orgs","repos_url":"https://api.github.com/users/umbraco/repos","events_url":"https://api.github.com/users/umbraco/events{/privacy}","received_events_url":"https://api.github.com/users/umbraco/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/umbraco/Umbraco-CMS","description":"The simple, flexible and friendly ASP.NET CMS used by more than 350.000 websites","fork":false,"url":"https://api.github.com/repos/umbraco/Umbraco-CMS","forks_url":"https://api.github.com/repos/umbraco/Umbraco-CMS/forks","keys_url":"https://api.github.com/repos/umbraco/Umbraco-CMS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/umbraco/Umbraco-CMS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/umbraco/Umbraco-CMS/teams","hooks_url":"https://api.github.com/repos/umbraco/Umbraco-CMS/hooks","issue_events_url":"https://api.github.com/repos/umbraco/Umbraco-CMS/issues/events{/number}","events_url":"https://api.github.com/repos/umbraco/Umbraco-CMS/events","assignees_url":"https://api.github.com/repos/umbraco/Umbraco-CMS/assignees{/user}","branches_url":"https://api.github.com/repos/umbraco/Umbraco-CMS/branches{/branch}","tags_url":"https://api.github.com/repos/umbraco/Umbraco-CMS/tags","blobs_url":"https://api.github.com/repos/umbraco/Umbraco-CMS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/umbraco/Umbraco-CMS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/umbraco/Umbraco-CMS/git/refs{/sha}","trees_url":"https://api.github.com/repos/umbraco/Umbraco-CMS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/umbraco/Umbraco-CMS/statuses/{sha}","languages_url":"https://api.github.com/repos/umbraco/Umbraco-CMS/languages","stargazers_url":"https://api.github.com/repos/umbraco/Umbraco-CMS/stargazers","contributors_url":"https://api.github.com/repos/umbraco/Umbraco-CMS/contributors","subscribers_url":"https://api.github.com/repos/umbraco/Umbraco-CMS/subscribers","subscription_url":"https://api.github.com/repos/umbraco/Umbraco-CMS/subscription","commits_url":"https://api.github.com/repos/umbraco/Umbraco-CMS/commits{/sha}","git_commits_url":"https://api.github.com/repos/umbraco/Umbraco-CMS/git/commits{/sha}","comments_url":"https://api.github.com/repos/umbraco/Umbraco-CMS/comments{/number}","issue_comment_url":"https://api.github.com/repos/umbraco/Umbraco-CMS/issues/comments{/number}","contents_url":"https://api.github.com/repos/umbraco/Umbraco-CMS/contents/{+path}","compare_url":"https://api.github.com/repos/umbraco/Umbraco-CMS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/umbraco/Umbraco-CMS/merges","archive_url":"https://api.github.com/repos/umbraco/Umbraco-CMS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/umbraco/Umbraco-CMS/downloads","issues_url":"https://api.github.com/repos/umbraco/Umbraco-CMS/issues{/number}","pulls_url":"https://api.github.com/repos/umbraco/Umbraco-CMS/pulls{/number}","milestones_url":"https://api.github.com/repos/umbraco/Umbraco-CMS/milestones{/number}","notifications_url":"https://api.github.com/repos/umbraco/Umbraco-CMS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/umbraco/Umbraco-CMS/labels{/name}","releases_url":"https://api.github.com/repos/umbraco/Umbraco-CMS/releases{/id}","deployments_url":"https://api.github.com/repos/umbraco/Umbraco-CMS/deployments","created_at":"2013-06-10T13:50:46Z","updated_at":"2016-06-21T22:01:35Z","pushed_at":"2016-06-21T19:36:11Z","git_url":"git://github.com/umbraco/Umbraco-CMS.git","ssh_url":"git@github.com:umbraco/Umbraco-CMS.git","clone_url":"https://github.com/umbraco/Umbraco-CMS.git","svn_url":"https://github.com/umbraco/Umbraco-CMS","homepage":"http://umbraco.com","size":194941,"stargazers_count":1241,"watchers_count":1241,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1001,"mirror_url":null,"open_issues_count":91,"forks":1001,"open_issues":91,"watchers":1241,"default_branch":"dev-v7"}},"_links":{"self":{"href":"https://api.github.com/repos/umbraco/Umbraco-CMS/pulls/1336"},"html":{"href":"https://github.com/umbraco/Umbraco-CMS/pull/1336"},"issue":{"href":"https://api.github.com/repos/umbraco/Umbraco-CMS/issues/1336"},"comments":{"href":"https://api.github.com/repos/umbraco/Umbraco-CMS/issues/1336/comments"},"review_comments":{"href":"https://api.github.com/repos/umbraco/Umbraco-CMS/pulls/1336/comments"},"review_comment":{"href":"https://api.github.com/repos/umbraco/Umbraco-CMS/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/umbraco/Umbraco-CMS/pulls/1336/commits"},"statuses":{"href":"https://api.github.com/repos/umbraco/Umbraco-CMS/statuses/d0c88dfe16962e2656d26745e652256580560f7b"}}}}
{"actor":{"display_login":"nul800sebastiaan"}}