Thanks !
Looking at the code, one thing I want to try is to move the sanitizing step first and then the checks after. So right now its
if (empty($current['filename']))
{
$offset += 512;
continue;
}
if ($current['type'] == 5 && substr($current['filename'], -1) != '/')
$current['filename'] .= '/';
foreach ($current as $k => $v)
{
if (in_array($k, $octdec))
$current[$k] = octdec(trim($v));
else
$current[$k] = trim($v);
}
lets reorder that to
foreach ($current as $k => $v)
{
if (in_array($k, $octdec))
$current[$k] = octdec(trim($v));
else
$current[$k] = trim($v);
}
// Blank record? This is probably at the end of the file.
if (empty($current['filename']))
{
$offset += 512;
continue;
}
if ($current['type'] == 5 && substr($current['filename'], -1) != '/')
$current['filename'] .= '/';
This places the trim of the array values and the octdec conversion first .. then the next to checks should have clean data. If it still fails at that point we will need to see if there are other than blanks in those fields.