diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2011-02-18 11:44:58 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2011-02-18 11:44:58 -0200 |
commit | 9334f7e48133c3a2309ed8dc39182cbc486570b6 (patch) | |
tree | 7d2aa4f0965d3b18ceff91f47712aca6787c1a4a /www/index.php | |
parent | 9440f6530bb5809e36d4220062fce040cb00f01c (diff) | |
download | original-9334f7e48133c3a2309ed8dc39182cbc486570b6.tar.gz original-9334f7e48133c3a2309ed8dc39182cbc486570b6.tar.bz2 |
Avoiding deprecation notices (3)
Diffstat (limited to 'www/index.php')
-rw-r--r-- | www/index.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/www/index.php b/www/index.php index 5711b87..f32d3b3 100644 --- a/www/index.php +++ b/www/index.php @@ -199,7 +199,7 @@ if (!$galerie) { $imgfiles = new SortDir($path); check($galerie); // check for nasty input while ($file = $imgfiles->read()) { - if (is_file("$path/$file") && eregi("^img-([0-9]+)\.(png|jpe?g)", $file, $x)) { + if (is_file("$path/$file") && preg_match("/^img-([0-9]+)\.(png|jpe?g)/i", $file, $x)) { $thumb = "$gallery_dir/$galerie/thumbs/img-${x[1]}.${x[2]}"; $imgsize = getimagesize("$root/$thumb"); @@ -220,7 +220,7 @@ if (!$galerie) { $fh = fopen("$gallery_dir/$galerie/comments/user_${x[1]}.txt","r"); while (!feof($fh)) { $line = fgets($fh); - if (eregi("commententry",$line)) $NumOfComments++; + if (preg_match("/commententry/i",$line)) $NumOfComments++; } fclose($fh); } @@ -232,8 +232,8 @@ if (!$galerie) { } if (file_exists("$gallery_dir/$galerie/comments/${x[1]}.txt") && $title = file_get_contents("$gallery_dir/$galerie/comments/${x[1]}.txt")) { - $title = ereg_replace("(\"|\')","",trim(strip_tags($title))); - $title = ereg_replace("(.{77}).*","\\1",$title); + $title = preg_replace("/(\"|\')/","",trim(strip_tags($title))); + $title = preg_replace("/(.{77}).*/","\\1",$title); } else $title = "Photo ${x[1]}"; @@ -332,7 +332,7 @@ if (!$galerie) { print "</a>\n"; print " : \n"; while ($thumbfile = $imgfiles->read()) { - if ( eregi("^img-([0-9]+)\.(png|jpe?g)", + if ( preg_match("/^img-([0-9]+)\.(png|jpe?g)/", $thumbfile, $x)) { $thumb = "$gallery_dir/$galerie/thumbs/img-${x[1]}.${x[2]}"; print " <a href=\"$ThisScript?galerie=$galerie&photo=${x[1]}"; |