Magento Fehlermeldung

If the error message "Magento: is_readable() expects parameter 1 to be a valid path, string given" appears in the Magento logs, this may be caused by a bug in the Varien library, more precisely, a bug in the file /lib/Varien/Io/File.php. Here, it is advisable to split the condition

 

if (is_string($src) && is_readable($src) && is_file($src)) {}

 

into three consecutive checks so that is_readable() is only applied to valid paths.

 

For example, the condition shown above can be changed into these three:

 

if (is_string($src)) {
if(file_exists($src)) {
if(is_file($src) && is_readable($src)) {
$result = true;
}
}
}

 

This ensures that all invalid $src variables are caught beforehand and the logs remain clean. Tested with Magento 1.9.2.4.