File: deprecated_eregi.patch

package info (click to toggle)
scuttle 0.7.4-6
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 1,508 kB
  • ctags: 1,956
  • sloc: php: 8,036; sh: 127; makefile: 48; sql: 43
file content (157 lines) | stat: -rw-r--r-- 5,724 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
Index: scuttle/services/userservice.php
===================================================================
--- scuttle.orig/services/userservice.php	2010-03-12 11:04:43.000000000 -0300
+++ scuttle/services/userservice.php	2010-03-12 11:04:43.000000000 -0300
@@ -40,7 +40,7 @@
         if(!empty($host)) {
             @exec("nslookup -type=$type $host", $output);
             while(list($k, $line) = each($output)) {
-                if(eregi("^$host", $line)) {
+                if(preg_match("/^$host/i", $line)) {
                     return true;
                 }
             }
Index: scuttle/includes/php-gettext/gettext.php
===================================================================
--- scuttle.orig/includes/php-gettext/gettext.php	2010-03-12 11:02:40.000000000 -0300
+++ scuttle/includes/php-gettext/gettext.php	2010-03-12 11:04:43.000000000 -0300
@@ -279,7 +279,7 @@
       } else {
         $header = $this->get_translation_string(0);
       }
-      if (eregi("plural-forms: ([^\n]*)\n", $header, $regs))
+      if (preg_match("/plural-forms: ([^\n]*)\n/i", $header, $regs))
         $expr = $regs[1];
       else
         $expr = "nplurals=2; plural=n == 1 ? 0 : 1;";
Index: scuttle/includes/db/oracle.php
===================================================================
--- scuttle.orig/includes/db/oracle.php	2010-03-12 11:02:40.000000000 -0300
+++ scuttle/includes/db/oracle.php	2010-03-12 11:04:43.000000000 -0300
@@ -102,7 +102,7 @@
 			$this->last_query = $query;
 			$this->num_queries++;
 
-			if(eregi("LIMIT", $query))
+			if(preg_match("/LIMIT/i", $query))
 			{
 				preg_match("/^(.*)LIMIT ([0-9]+)[, ]*([0-9]+)*/s", $query, $limits);
 
@@ -119,7 +119,7 @@
 				}
 			}
 
-			if(eregi("^(INSERT|UPDATE) ", $query))
+			if(preg_match("/^(INSERT|UPDATE) /i", $query))
 			{
 				$query = preg_replace("/\\\'/s", "''", $query);
 			}
@@ -372,7 +372,7 @@
 		}
 		if($query_id && $this->last_query_text[$query_id] != "")
 		{
-			if( eregi("^(INSERT{1}|^INSERT INTO{1})[[:space:]][\"]?([a-zA-Z0-9\_\-]+)[\"]?", $this->last_query_text[$query_id], $tablename))
+			if( preg_match("/^(INSERT{1}|^INSERT INTO{1})[[:space:]][\"]?([a-zA-Z0-9\_\-]+)[\"]?/i", $this->last_query_text[$query_id], $tablename))
 			{
 				$query = "SELECT ".$tablename[2]."_id_seq.currval FROM DUAL";
 				$stmt = @OCIParse($this->db_connect_id, $query);
@@ -406,7 +406,7 @@
 		}
 		if($query_id && $this->last_query_text[$query_id] != "")
 		{
-			if( eregi("^(INSERT{1}|^INSERT INTO{1})[[:space:]][\"]?([a-zA-Z0-9\_\-]+)[\"]?", $this->last_query_text[$query_id], $tablename))
+			if( preg_match("/^(INSERT{1}|^INSERT INTO{1})[[:space:]][\"]?([a-zA-Z0-9\_\-]+)[\"]?/i", $this->last_query_text[$query_id], $tablename))
 			{
 				$query = "SELECT ".$tablename[2]."_id_seq.CURRVAL FROM DUAL";
 				$temp_q_id =  @OCIParse($this->db_connect_id, $query);
@@ -465,4 +465,4 @@
 
 } // if ... define
 
-?>
\ No newline at end of file
+?>
Index: scuttle/includes/db/db2.php
===================================================================
--- scuttle.orig/includes/db/db2.php	2010-03-12 11:02:40.000000000 -0300
+++ scuttle/includes/db/db2.php	2010-03-12 11:04:43.000000000 -0300
@@ -100,9 +100,9 @@
 		{
 			$this->num_queries++;
 
-			if(!eregi("^INSERT ",$query))
+			if(!preg_mach("/^INSERT /i",$query))
 			{
-				if(eregi("LIMIT", $query))
+				if(preg_match("/LIMIT/i", $query))
 				{
 					preg_match("/^(.*)LIMIT ([0-9]+)[, ]*([0-9]+)*/s", $query, $limits);
 
@@ -134,7 +134,7 @@
 				}
 
 				$result_id = $this->query_result;
-				if($this->query_result && eregi("^SELECT", $query))
+				if($this->query_result && preg_match("/^SELECT/i", $query))
 				{
 
 					for($i = 1; $i < odbc_num_fields($result_id)+1; $i++)
@@ -166,7 +166,7 @@
 			}
 			else
 			{
-				if(eregi("^(INSERT|UPDATE) ", $query))
+				if(preg_match("/^(INSERT|UPDATE) /i", $query))
 				{
 					$query = preg_replace("/\\\'/s", "''", $query);
 				}
@@ -414,4 +414,4 @@
 
 } // if ... define
 
-?>
\ No newline at end of file
+?>
Index: scuttle/includes/db/mssql-odbc.php
===================================================================
--- scuttle.orig/includes/db/mssql-odbc.php	2010-03-12 11:02:40.000000000 -0300
+++ scuttle/includes/db/mssql-odbc.php	2010-03-12 11:04:43.000000000 -0300
@@ -221,7 +221,7 @@
 				$this->num_rows[$result] = sizeof($this->result_rowset[$result]);	
 			}
 		}
-		else if (eregi("^INSERT ", $query))
+		else if (preg_match("/^INSERT /i", $query))
 		{
 			$result = @odbc_exec($this->db_connect_id, $query);
 
@@ -573,4 +573,4 @@
 
 } // if ... define
 
-?>
\ No newline at end of file
+?>
Index: scuttle/importNetscape.php
===================================================================
--- scuttle.orig/importNetscape.php	2010-03-12 11:02:40.000000000 -0300
+++ scuttle/importNetscape.php	2010-03-12 11:05:30.000000000 -0300
@@ -48,7 +48,7 @@
         foreach ($attributes as $attribute) {
             $att = preg_split('/\s*=\s*/s', $attribute, 2);
             $attrTitle = $att[0];
-            $attrVal = eregi_replace('"', '&quot;', preg_replace('/([\'"]?)(.*)\1/', '$2', $att[1]));
+            $attrVal = preg_replace('/"/i', '&quot;', preg_replace('/([\'"]?)(.*)\1/', '$2', $att[1]));
             switch ($attrTitle) {
                 case "HREF":
                     $bAddress = $attrVal;
@@ -58,7 +58,8 @@
                     break;
             }
         }
-        $bTitle = eregi_replace('"', '&quot;', trim($titles[$i]));
+        $bTitle = preg_replace('/"/i', '&quot;', trim($titles[$i]));
+
 
         if ($bookmarkservice->bookmarkExists($bAddress, $userservice->getCurrentUserId())) {
             $tplVars['error'] = T_('You have already submitted this bookmark.');