|
@@ 203-206 (lines=4) @@
|
| 200 |
|
|
| 201 |
|
// Check if we can match the query against any of the major types |
| 202 |
|
switch (true) { |
| 203 |
|
case stripos($query, 'SELECT') !== false: |
| 204 |
|
$keywords = array('SELECT', 'FROM', 'WHERE', 'HAVING', 'ORDER BY', 'LIMIT'); |
| 205 |
|
$required = 2; |
| 206 |
|
break; |
| 207 |
|
|
| 208 |
|
case stripos($query, 'DELETE') !== false : |
| 209 |
|
$keywords = array('DELETE', 'FROM', 'WHERE', 'ORDER BY', 'LIMIT'); |
|
@@ 208-211 (lines=4) @@
|
| 205 |
|
$required = 2; |
| 206 |
|
break; |
| 207 |
|
|
| 208 |
|
case stripos($query, 'DELETE') !== false : |
| 209 |
|
$keywords = array('DELETE', 'FROM', 'WHERE', 'ORDER BY', 'LIMIT'); |
| 210 |
|
$required = 2; |
| 211 |
|
break; |
| 212 |
|
|
| 213 |
|
case stripos($query, 'UPDATE') !== false : |
| 214 |
|
$keywords = array('UPDATE', 'SET', 'WHERE', 'ORDER BY', 'LIMIT'); |
|
@@ 213-216 (lines=4) @@
|
| 210 |
|
$required = 2; |
| 211 |
|
break; |
| 212 |
|
|
| 213 |
|
case stripos($query, 'UPDATE') !== false : |
| 214 |
|
$keywords = array('UPDATE', 'SET', 'WHERE', 'ORDER BY', 'LIMIT'); |
| 215 |
|
$required = 2; |
| 216 |
|
break; |
| 217 |
|
|
| 218 |
|
case stripos($query, 'INSERT') !== false : |
| 219 |
|
$keywords = array('INSERT', 'INTO', 'VALUE', 'VALUES'); |
|
@@ 218-221 (lines=4) @@
|
| 215 |
|
$required = 2; |
| 216 |
|
break; |
| 217 |
|
|
| 218 |
|
case stripos($query, 'INSERT') !== false : |
| 219 |
|
$keywords = array('INSERT', 'INTO', 'VALUE', 'VALUES'); |
| 220 |
|
$required = 2; |
| 221 |
|
break; |
| 222 |
|
|
| 223 |
|
// If there's no match so far just truncate it to the maximum allowed by the interface |
| 224 |
|
default: |