Home > Backend Development > PHP Tutorial > PHP magic_quotes_gpc dynamically close invalid solution

PHP magic_quotes_gpc dynamically close invalid solution

WBOY
Release: 2016-07-25 09:07:26
Original
973 people have browsed it
  1. if (ini_get('magic_quotes_gpc')) {
  2. function stripslashesRecursive(array $array)
  3. {
  4. foreach ($array as $k => $v) {
  5. if (is_string($v)) {
  6. $array[$k] = stripslashes($v);
  7. } else if (is_array($v)) {
  8. $array[$k] = stripslashesRecursive($v);
  9. }
  10. }
  11. return $array;
  12. }
  13. $_GET = stripslashesRecursive($_GET);
  14. $_POST = stripslashesRecursive($_POST);
  15. }
  16. ?>
复制代码


source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template