function download_item($dir, $item)
{
	// Security Fix:
	$item=basename($item);

	if (!permissions_grant($dir, $item, "read"))
		show_error($GLOBALS["error_msg"]["accessfunc"]);

	if (!get_is_file($dir,$item))
    {
        _debug("error download");
        show_error($item.": ".$GLOBALS["error_msg"]["fileexist"]);
    }
	if (!get_show_item($dir, $item))
        show_error($item.": ".$GLOBALS["error_msg"]["accessfile"]);

	$abs_item = get_abs_item($dir,$item);
    _download($abs_item, $item);
}
The software uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the software does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.