discuz这段代码如何理解

WBOY
Release: 2016-06-23 13:44:21
Original
895 people have browsed it

这段代码的作用是为了啥
if (isset($_REQUEST['GLOBALS']) OR isset($_FILES['GLOBALS'])) {
exit('Request tainting attempted.');
}


回复讨论(解决方案)

Request tainting attempted 试图请求改变

即传入的参数不能用 GLOBALS 做变量名

Request tainting attempted 试图请求改变

即传入的参数不能用 GLOBALS 做变量名


为啥不让GLOBALS做变量名呢,难道作了会怎么样吗?

那你就要看他的代码了
由于 $GLOBALS 是超全局变量,如果被 extract 覆盖了,就全完了

那你就要看他的代码了
由于 $GLOBALS 是超全局变量,如果被 extract 覆盖了,就全完了



还是木理解,能举一个小粟子吗

$x = 123;$a = array('x' => 'abc');extract($a);echo $x;
Copy after login
abc
$a 被改变了

Related labels:
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!