1

""Eregi" works in php5.6 for this Photo Gallery Module: http://taraskrysa.com/pages/media/photo_gallery.php

BUT, preg_match in php7.2 does not work for the same Gallery Module. I currently changed eregi to preg_match on the page link below, but no images are pulled from the folder assigned to the gallery and no errors show up either: http://www.carefreeseniors.com/pages/gallery/birthdays.php

I have changed eregi to preg_match in the view.php file

// Read the picture directory:

while (($filename = readdir($d)) !== false) {

    if ($filename == $thumbdir || ($filename == '..' && $dirname == '') || ($filename != '..' && substr($filename, 0, 1) == '.')) {

        continue;

    }

    $file = $realdir . $delim . $filename;

    if (is_dir($file)) {

        $dirs[] = $filename;

    } elseif (preg_match($query, $file)) { 

        $pics[] = $filename;

    }

}

I was hoping that changing the eregi to preg_match would fix the issue and pull the photos into the gallery. But, it's not working and all the Galleries of this site are now not showing up. Any help would be appreciated.

I am happy to supply the entire Module if it helps get this resolved quickly.

Toto
  • 89,455
  • 62
  • 89
  • 125
  • Try `preg_match('/' . $query . '/', $file)`. What is in the `$query`? – Wiktor Stribiżew Apr 30 '19 at 15:50
  • Possible duplicate of [How can I convert ereg expressions to preg in PHP?](https://stackoverflow.com/questions/6270004/how-can-i-convert-ereg-expressions-to-preg-in-php) – Toto Jun 02 '19 at 11:33

0 Answers0