Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
shenzhe committed Feb 20, 2016
1 parent 389440e commit 7fa0be5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.idea
6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions server.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,18 @@ function mylog($msg, $filename='hook_error'){
$http->reload();
return;
}
if(empty($request->post['hook'])) {
if(empty($request->post['payload'])) {
mylog('hook data empty');
return;
}
$data = json_decode($request->post['hook'], true);
if(empty($data)) {
$datas = json_decode($request->post['payload'], true);
if(empty($datas['hook'])) {
//错误的数据
mylog('hook no json data');
return;
}
if(PASSWORD && $data['password'] != PASSWORD) {
$data = $datas['hook'];
if(PASSWORD && $data['config']['secret'] != PASSWORD) {
//密码不匹配
mylog('password error');
return ;
Expand Down

0 comments on commit 7fa0be5

Please sign in to comment.