来源:自学PHP网 时间:2015-04-15 15:00 作者: 阅读:次
[导读] 起了一个坏头,潜在影响包括最新版discuzx3 2等详细说明:从官方下了最新的微信开放平台接入示例文件(php)http: mp weixin qq com mpres htmledition res wx_sample zipwx_sample php行27$postStr = $GLOBA...
|
起了一个坏头,潜在影响包括最新版discuzx3.2等 从官方下了最新的微信开放平台接入示例文件(php)
$postStr = $GLOBALS["HTTP_RAW_POST_DATA"];
//extract post data
if (!empty($postStr)){
$postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);
$fromUsername = $postObj->FromUserName;
$toUsername = $postObj->ToUserName;
$keyword = trim($postObj->Content)
private function checkSignature(){
$signature = $_GET["signature"];
$timestamp = $_GET["timestamp"];
$nonce = $_GET["nonce"];
$token = TOKEN;
$tmpArr = array($token, $timestamp, $nonce);
sort($tmpArr, SORT_STRING);
$tmpStr = implode( $tmpArr );
$tmpStr = sha1( $tmpStr );
if( $tmpStr == $signature ){
return true;
}else{
return false;
}
}
}
$tmpArr = array($token, $timestamp, $nonce);
$postdata = file_get_contents("php://input");
if ($postdata) {
if (!$this->_checkSignature()) {
return;
}
$postObj = simplexml_load_string($postdata, 'SimpleXMLElement', LIBXML_NOCDATA);
$postObj = $this->_handlePostObj($postObj);
$this->_activeHook('receiveAllStart', $postObj);
修复方案:慎用simplexml_load_string |
自学PHP网专注网站建设学习,PHP程序学习,平面设计学习,以及操作系统学习
京ICP备14009008号-1@版权所有www.zixuephp.com
网站声明:本站所有视频,教程都由网友上传,站长收集和分享给大家学习使用,如由牵扯版权问题请联系站长邮箱904561283@qq.com