aboutsummaryrefslogtreecommitdiff
path: root/www/inc
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2011-02-18 11:44:58 -0200
committerSilvio Rhatto <rhatto@riseup.net>2011-02-18 11:44:58 -0200
commit9334f7e48133c3a2309ed8dc39182cbc486570b6 (patch)
tree7d2aa4f0965d3b18ceff91f47712aca6787c1a4a /www/inc
parent9440f6530bb5809e36d4220062fce040cb00f01c (diff)
downloadoriginal-9334f7e48133c3a2309ed8dc39182cbc486570b6.tar.gz
original-9334f7e48133c3a2309ed8dc39182cbc486570b6.tar.bz2
Avoiding deprecation notices (3)
Diffstat (limited to 'www/inc')
-rw-r--r--www/inc/exif.inc.php2
-rw-r--r--www/inc/funkce.inc.php18
-rw-r--r--www/inc/photo.class.inc.php2
-rw-r--r--www/inc/www.class.inc.php4
4 files changed, 13 insertions, 13 deletions
diff --git a/www/inc/exif.inc.php b/www/inc/exif.inc.php
index 00068c8..ac30a16 100644
--- a/www/inc/exif.inc.php
+++ b/www/inc/exif.inc.php
@@ -46,7 +46,7 @@ function formatEXIF ($k,$v) {
break;
case "DateTime":
//return date("M d Y H:i:s", $v);
- ereg("^([0-9]{4}):([0-9]{1,2}):([0-9]{1,2}) (.*)",$v,$x);
+ preg_match("/^([0-9]{4}):([0-9]{1,2}):([0-9]{1,2}) (.*)/",$v,$x);
return $x[1] . "/" . $x[2] . "/" . $x[3] . " " . $x[4];
break;
default:
diff --git a/www/inc/funkce.inc.php b/www/inc/funkce.inc.php
index de4b592..1f89341 100644
--- a/www/inc/funkce.inc.php
+++ b/www/inc/funkce.inc.php
@@ -3,8 +3,8 @@
function check($file) {
global $gallery_dir, $page;
-# if (eregi("[^0-9a-z\_\-\ ]",$file) || !file_exists("$gallery_dir/$file")) {
-# if (eregi("CVS",$file) || !file_exists("$gallery_dir/$file")) {
+# if (preg_match("/[^0-9a-z\_\-\ ]/i",$file) || !file_exists("$gallery_dir/$file")) {
+# if (preg_match("/CVS/i",$file) || !file_exists("$gallery_dir/$file")) {
if (!file_exists("$gallery_dir/$file")) {
echo "funkce.inc.php/check(): Bad input";
$page->footer();
@@ -16,19 +16,19 @@ function browserCheck() {
global $HTTP_USER_AGENT;
$HTTP_USER_AGENT=$_SERVER["HTTP_USER_AGENT"];
- if (eregi("(MSIE.[456789]).*Mac.*",$HTTP_USER_AGENT)) {
+ if (preg_match("/(MSIE.[456789]).*Mac.*/i",$HTTP_USER_AGENT)) {
return("macie4+");
- } elseif (eregi("(MSIE.[678])",$HTTP_USER_AGENT)) {
+ } elseif (preg_match("/(MSIE.[678])/i",$HTTP_USER_AGENT)) {
return("ie6+");
- } elseif (eregi("(MSIE.[45])",$HTTP_USER_AGENT)) {
+ } elseif (preg_match("/(MSIE.[45])/i",$HTTP_USER_AGENT)) {
return("ie4+");
- } elseif (eregi("Opera",$HTTP_USER_AGENT)) {
+ } elseif (preg_match("/Opera/i",$HTTP_USER_AGENT)) {
return("opera");
- } elseif (eregi("(Mozilla.4)",$HTTP_USER_AGENT)) {
+ } elseif (preg_match("/(Mozilla.4)/i",$HTTP_USER_AGENT)) {
return("netscape4");
- } elseif (eregi("(Mozilla.[5-9])",$HTTP_USER_AGENT)) {
+ } elseif (preg_match("/(Mozilla.[5-9])/i",$HTTP_USER_AGENT)) {
return("mozilla");
- } elseif (eregi("KMeleon",$HTTP_USER_AGENT)) {
+ } elseif (preg_match("/KMeleon/i",$HTTP_USER_AGENT)) {
return("mozilla");
} else {
return("Netscape3");
diff --git a/www/inc/photo.class.inc.php b/www/inc/photo.class.inc.php
index 1b677c1..46f1a8f 100644
--- a/www/inc/photo.class.inc.php
+++ b/www/inc/photo.class.inc.php
@@ -102,7 +102,7 @@ class C_photo {
return;
}
//parse buffer
- if(eregi("^<span>(.*)</span>( - )?(.*)", $buffer, $x)) {
+ if(preg_match("/^<span>(.*)</span>( - )?(.*)/i", $buffer, $x)) {
$this->name = $x[1]; //mostly "Photo"
$this->caption = chop($x[3]);
} else {
diff --git a/www/inc/www.class.inc.php b/www/inc/www.class.inc.php
index bb61a5c..312ba50 100644
--- a/www/inc/www.class.inc.php
+++ b/www/inc/www.class.inc.php
@@ -289,14 +289,14 @@ class C_www {
$comment_data = stripslashes(strip_tags($comment_data,$allowedTags));
// thanks google:
// http://www.google.com/googleblog/2005/01/preventing-comment-spam.html
- $comment_data = eregi_replace("<a ","<a rel=\"nofollow\" ",$comment_data);
+ $comment_data = preg_replace("/<a ","<a rel=\"nofollow\" /i",$comment_data);
#further comment spam
$comment_blacklist = array("pharmacy", "poker", "Viagra");
foreach($comment_blacklist as $blackword) {
$check = addslashes($blackword);
- if (eregi($check,$comment_data)) {
+ if (preg_match("/$check/i",$comment_data)) {
#write error message
$this->error( __('No comment spam'), __('Your comment includes blacklisted word') . __('No comment spam') );
$this->footer();