爱就爱了

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 9165|回复: 0

PHP探秘(一)--魔术引用(2):mediawiki对魔术引用的处理

[复制链接]
发表于 2014-1-10 14:41:10 | 显示全部楼层 |阅读模式

MediaWiki 默认是关掉魔术引用的。


/**         * Recursively strips slashes from the given array;         * used for undoing the evil that is magic_quotes_gpc.         * @param $arr array: will be modified         * @return array the original array         * @private         */        function &fix_magic_quotes( &$arr ) {                foreach( $arr as $key => $val ) {                        if( is_array( $val ) ) {                                $this->fix_magic_quotes( $arr[$key] );                        } else {                                $arr[$key] = stripslashes( $val );                        }                }                return $arr;        }        /**         * If magic_quotes_gpc option is on, run the global arrays         * through fix_magic_quotes to strip out the stupid slashes.         * WARNING: This should only be done once! Running a second         * time could damage the values.         * @private         */        function checkMagicQuotes() {                if ( function_exists( \'get_magic_quotes_gpc\' ) && get_magic_quotes_gpc() ) {                        $this->fix_magic_quotes( $_COOKIE );                        $this->fix_magic_quotes( $_ENV );                        $this->fix_magic_quotes( $_GET );                        $this->fix_magic_quotes( $_POST );                        $this->fix_magic_quotes( $_REQUEST );                        $this->fix_magic_quotes( $_SERVER );                }        }
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|平龙认个人分站 - 爱就爱了 ( 豫ICP备14029057号-2、4、5 )
豫公网安备 41010502002156号

GMT+8, 2024-5-7 01:52 , Processed in 0.043603 second(s), 19 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表