getimagesize() when file name includes single quotes
<p>Sample $file name: Last,_First (1942) 'Mel'.jpg</p>

<p>I get an error message when using getimagesize() whenever the filename includes single quotes. What's the solution? Here's what I have:</p>

<pre><code>  $file = htmlspecialchars_decode($file, ENT_QUOTES);
  $filename = $dir.$file.'.jpg';
  $filename = str_replace(' ','_',$filename);
  list($width, $height, $type, $attr) = getimagesize($filename);
</code></pre>

<p>I've tried replacing the ' with \' but that didn't help</p>
