From d329f92c31a2022a3fe1edf5743770759d628172 Mon Sep 17 00:00:00 2001 From: Josh Sherman Date: Fri, 4 Jan 2013 11:49:34 -0500 Subject: [PATCH] Added another sanity check --- bootstrap/modules/callback/github.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bootstrap/modules/callback/github.php b/bootstrap/modules/callback/github.php index 9ea1514..02f9844 100644 --- a/bootstrap/modules/callback/github.php +++ b/bootstrap/modules/callback/github.php @@ -6,7 +6,8 @@ class callback_github extends Module public function __default() { - if (isset($_SERVER['REMOTE_ADDR'], $_POST['payload']) + if (isset($_SERVER['HTTP_USER_AGENT'], $_SERVER['REMOTE_ADDR'], $_POST['payload']) + && $_SERVER['HTTP_USER_AGENT'] == 'GitHub Services Web Hook' && in_array($_SERVER['REMOTE_ADDR'], array('207.97.227.253', '50.57.128.197', '108.171.174.178'))) { `git pull origin master`;