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

PHP magic_quotes_gpc dynamically close invalid solution

WBOY
WBOYOriginal
2016-07-25 09:07:26960browse
  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. ?>
复制代码


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