Today when using a regular expression, I got an error message: Deprecated: Function eregi() is deprecated in. Later I found out that the reason is that our php5.3 does not support the eregi function in 5.3. You can use preg_match directly instead. .
Before changed: function inject_check($sql_str) {
代码如下 |
复制代码 |
$sql_str = strtolower($sql_str);
return eregi('fopen|post|eval|select|insert|and|or|update|delete|'|/*|*|../|./|union|into|load_file|outfile', $sql_str); // 进行过滤
} |
Solution:
Find the file location where the code is located
The code is as follows
代码如下 |
复制代码 |
function inject_check($sql_str) {
$sql_str = strtolower($sql_str);
return preg_match('/fopen|post|eval|select|insert|and|or|update|delete|'|/*|*|../|./|union|into|load_file|outfile/', $sql_str); // 进行过滤
}
|
|
Copy code
|
|
function inject_check($sql_str) {
$sql_str = strtolower($sql_str);
return preg_match('/fopen|post|eval|select|insert|and|or|update|delete|'|/*|*|../|./|union|into|load_file|outfile/', $sql_str) ; // Filter
}
Note: Be sure to add '/' at the beginning and end.
http://www.bkjia.com/PHPjc/632111.htmlwww.bkjia.comtrue
http: //www.bkjia.com/PHPjc/632111.htmlToday when using a regular expression, it prompted an error message Deprecated: Function eregi() is deprecated in. Later I found out the reason. This is our php5.3. The eregi function is no longer supported in 5.3. You can directly...
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn