Mantis - Quercus
Viewing Issue Advanced Details
3587 major always 06-29-09 09:34 08-27-09 11:40
tomi_m  
nam  
normal  
closed 4.0.0  
fixed  
none    
none 4.0.2  
0003587: NumberFormatException when calling $result = file_get_contents($url);
When trying to call file_get_contents($data); in PHP script where $data is url I get NumberFormatException. I have found bug in class method com.caucho.vfs.HttpStream.parseHeaders() when calling parseInt in line 814 trying to get http response content-length value.
Parameter passed to parseInt should be trimmed.


Original source
if (key.matchesIgnoreCase("content-length")) {
        _contentLength = Integer.parseInt(value);
      }

After modifying
if (key.matchesIgnoreCase("content-length")) {
        _contentLength = Integer.parseInt(value.trim());
      }

Notes
(0004182)
nam   
08-27-09 11:40   
php/164v