{
  "WorkItem": {
    "AffectedComponent": {
      "Name": "",
      "DisplayName": ""
    },
    "ClosedComment": "fixed in changeset 81486.  v1.9.1.6 is the first binary release containing this fix. ",
    "ClosedDate": "2011-08-03T00:36:26.187-07:00",
    "CommentCount": 0,
    "Custom": null,
    "Description": "Hi\n \nUsed Version: V1.9.1.5, build from 2010-02-26 05:30\n \nI try to extract files from a zip file (which was created with SharpZipLib by a customer) in a folder \n- I set the property 'FlattenFoldersOnExtract'\n-> The \"zipFile.Extract(path)\" / \"zipFile.ExtractAll(path)\" function extract the compressed files every time to the original full compressed path of the files. It ignores the default path which I pass to the extract functions.\nIt makes no difference if I set the property 'FlattenFoldersOnExtract' or not.\n \n* A sample file can be found in the attachment.\n \n \nMy workaround: I overwrite the filename with a new filename without any path information.\nBut this cannot be a solution I think.\n \n \nRegards,\nDemian",
    "LastUpdatedDate": "2013-05-16T05:31:45.043-07:00",
    "PlannedForRelease": "",
    "ReleaseVisibleToPublic": false,
    "Priority": {
      "Name": "Low",
      "Severity": 50,
      "Id": 1
    },
    "ProjectName": "DotNetZip",
    "ReportedDate": "2010-08-18T06:17:36.45-07:00",
    "Status": {
      "Name": "Closed",
      "Id": 4
    },
    "ReasonClosed": {
      "Name": "Unassigned"
    },
    "Summary": "FlattenFoldersOnExtract does not work correctly",
    "Type": {
      "Name": "Issue",
      "Id": 3
    },
    "VoteCount": 1,
    "Id": 11772
  },
  "FileAttachments": [
    {
      "FileId": 3412,
      "FileName": "Import_20100818070914.zip",
      "DownloadUrl": ".\\3412"
    }
  ],
  "Comments": [
    {
      "Message": "Hi Cheso\r\n\r\nI have posted the issue 11772.\r\nIt appears because the compressed files contains an absolute path with drive letters.\r\n\r\nI have debugged the last commited version and do follow changes:\r\n\r\n\r\nZIP Partial DLL: ZipEntry.Extract.cs\r\n\r\nYour original code:\r\n\r\n1218:   private bool ValidateOutput(string basedir, Stream outstream, out string OutputFile)\r\n       {\r\n           if (basedir != null)\r\n           {\r\n               // Sometimes the name on the entry starts with a slash.\r\n               // Rather than unpack to the root of the volume, we're going to\r\n               // drop the slash and unpack to the specified base directory.\r\n               string f = this.FileName.Replace(\"\\\\\",\"/\");\r\n               if (f.StartsWith(\"/\"))\r\n1227:               f= this.FileName.Substring(1);\r\n\r\n\r\nMy modified version:\r\n\r\n1218:   private bool ValidateOutput(string basedir, Stream outstream, out string OutputFile)\r\n       {\r\n           if (basedir != null)\r\n           {\r\n               // Sometimes the name on the entry starts with a slash.\r\n               // Rather than unpack to the root of the volume, we're going to\r\n               // drop the slash and unpack to the specified base directory.\r\n               string f = this.FileName.Replace(\"\\\\\",\"/\");\r\n               // remove drive letter with separator\r\n               if (f.IndexOf(':') == 1)\r\n                   f= f.Substring(2);\r\n               //remove all beginning slashes (UNC path)\r\n               while (f.StartsWith(\"/\"))\r\n               {\r\n                   f= f.Substring(1);\r\n               }\r\n\r\n\r\nYou should change your line 1227 in each case into follow, otherwise you re-read the original filename and the replacement of the slashes are undo.\r\n1227:               f= f.Substring(1);\r\n\r\n\r\nRegards,\r\nDemian",
      "PostedDate": "2010-08-20T06:21:49.54-07:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2011-08-02T17:20:00.95-07:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2011-08-03T00:36:26.187-07:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2013-02-21T18:43:27.727-08:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2013-05-16T05:31:45.043-07:00",
      "Id": -2147483648
    }
  ]
}