首页 > Web开发 > 详细

php安全 过滤、验证、转义

时间:2018-07-17 22:30:38      阅读:176      评论:0      收藏:0      [点我收藏+]

不要相信外部源

  • $_GET
  • $_POST
  • $_REQUEST
  • $_COOKIE
  • $argv
  • php://stdin
  • php://input
  • file_get_contents()
  • 远程数据库
  • 远程api
  • 来自客户端的数据

htmlentities

<?php
$input = ‘<p><script>alert("You won the Nigerian lottery!");</script></p>‘;
echo htmlentities($input, ENT_QUOTES, ‘UTF-8‘);
// <p><script>alert("You won the Nigerian lottery!");</script></p>

  

htmlpurifier

 

php安全 过滤、验证、转义

原文:https://www.cnblogs.com/mingzhanghui/p/9326322.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!