OSDN Git Service

Replace whole ereg series to preg series.
authorsakamocchi <sakamocchi@1ca29b6e-896d-4ea0-84a5-967f57386b96>
Wed, 2 Feb 2011 07:41:47 +0000 (07:41 +0000)
committersakamocchi <sakamocchi@1ca29b6e-896d-4ea0-84a5-967f57386b96>
Wed, 2 Feb 2011 07:41:47 +0000 (07:41 +0000)
git-svn-id: https://svn.sourceforge.jp/svnroot/nucleus-jp/nucleus-jp/trunk@1137 1ca29b6e-896d-4ea0-84a5-967f57386b96

utf8/install/index.php
utf8/nucleus/libs/SEARCH.php

index ab5fac3..761a3cc 100755 (executable)
@@ -182,7 +182,7 @@ function showInstallForm() {
                        $match = explode('.', $row[1]);\r
                } else {\r
                        $output = (function_exists('shell_exec')) ? @shell_exec('mysql -V') : '0.0.0';\r
-                       preg_match('@[0-9]+\.[0-9]+\.[0-9]+@', $output, $version);\r
+                       preg_match('#[0-9]+\.[0-9]+\.[0-9]+#', $output, $version);\r
                        $match = explode('.', $version[0]);\r
 \r
                        if ($match[0] == '') {\r
@@ -544,7 +544,7 @@ function doInstall() {
                array_push($errors, _ERROR3);\r
        }\r
 \r
-       if (($mysql_usePrefix == 1) && (!eregi('^[a-zA-Z0-9_]+$', $mysql_prefix) ) ) {\r
+       if (($mysql_usePrefix == 1) && (!preg_match('#^[a-zA-Z0-9_]+$#', $mysql_prefix) ) ) {\r
                array_push($errors, _ERROR4);\r
        }\r
 \r
@@ -1153,7 +1153,7 @@ function endsWithSlash($s) {
  * Checks if email address is valid\r
  */\r
 function _isValidMailAddress($address) {\r
-       if (preg_match("/^[a-zA-Z0-9\._-]+@+[A-Za-z0-9\._-]+\.+[A-Za-z]{2,4}$/", $address) ) {\r
+       if (preg_match("#^[a-zA-Z0-9\._-]+@+[A-Za-z0-9\._-]+\.+[A-Za-z]{2,4}$#", $address) ) {\r
                return 1;\r
        } else {\r
                return 0;\r
@@ -1165,7 +1165,7 @@ function _isValidMailAddress($address) {
 // logic: starts and ends with a non space, can contain spaces in between\r
 //             min 2 chars\r
 function _isValidShortName($name) {\r
-       if (eregi("^[a-z0-9]+$", $name) ) {\r
+       if (preg_match("#^[a-zA-Z0-9]+$#", $name) ) {\r
                return 1;\r
        } else {\r
                return 0;\r
@@ -1177,7 +1177,7 @@ function _isValidShortName($name) {
 // returns true if the given string is a valid display name\r
 // (to check nicknames)\r
 function _isValidDisplayName($name) {\r
-       if (eregi("^[a-z0-9]+[a-z0-9 ]*[a-z0-9]+$", $name) ) {\r
+       if (preg_match("#^[a-zA-Z0-9]+[a-zA-Z0-9 ]*[a-zA-Z0-9]+$#", $name) ) {\r
                return 1;\r
        } else {\r
                return 0;\r
index a1646e5..c34d3de 100755 (executable)
@@ -229,10 +229,10 @@ class SEARCH {
                $result = preg_replace("/([[:space:]]{2,})/", ' ', $result);
                
                /* convert normal boolean operators to shortened syntax */
-               $result = eregi_replace(' not ', ' -', $result);
-               $result = eregi_replace(' and ', ' ',  $result);
-               $result = eregi_replace(' or ',  ',',  $result);
-
+               $result = preg_replace('# not #i', ' -', $result);
+               $result = preg_replace('# and #i', ' ',  $result);
+               $result = preg_replace('# or #i',  ',',  $result);
+               
                /* strip excessive whitespace */
                $result = str_replace(', ', ',',  $result);
                $result = str_replace(' ,', ',',  $result);
@@ -281,4 +281,4 @@ class SEARCH {
                return $like;
        }
 }
-?>
\ No newline at end of file
+?>