I think I may have a Heisenbug on my hands. My code so far looks like this:
$enc = $_REQUEST['l'];
$filename = DecryptString($enc);
echo $filename; //Displays: uploads/Maid with the Flaxen Hair.mp3
if (is_dir($filename)) //Gives the error: "Warning: is_dir() expects parameter 1 to be a valid path, string given"
{
Download($filename);
}
However, if I take what as echo'ed earlier, which was uploads/Maid with the Flaxen Hair.mp3
, and run is_dir("uploads/Maid with the Flaxen Hair.mp3")
, it returns as expected.
So if I pass the variable into is_dir
, it fails, but if I pass the value of the variable it works. What's the catch?