I'm in the process of migrating a horrible drupal site to a new server - a server with a newer version of PHP. Checking the site I get the following error:
Deprecated: Function ereg() is deprecated in /var/sites/n/nanohex.org/public_html/includes/file.inc on line 902
Line 902 looks like the following:
elseif ($depth >= $min_depth && ereg($mask, $file)) {
My understanding is that ereg is no longer used and I need to replace with pregmatch.
Changing the code the following...
elseif ($depth >= $min_depth && preg_match('/\.([^\.]*$)/', $mask, $file)) {
throws up this error instead:
Warning: basename() expects parameter 1 to be string, array given in /var/sites/n/nanohex.org/public_html/includes/file.inc on line 905
Line 905 looks like this:
$basename = basename($file);
What am I doing wrong?