From c0795e594eed9b9576973fe8e3b9e6edbdfbb517 Mon Sep 17 00:00:00 2001 From: znaeff Date: Thu, 12 May 2016 13:59:50 +0500 Subject: [PATCH] Added values to sender_info. --- Antispam.hooks.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Antispam.hooks.php b/Antispam.hooks.php index 0a6e0e6..bcf451f 100644 --- a/Antispam.hooks.php +++ b/Antispam.hooks.php @@ -165,7 +165,13 @@ public static function onEditFilter ( $editor, $text, $section, &$error, $summa $ctRequest->sender_ip = $wgRequest->getIP(); $ctRequest->js_on = CTBody::JSTest(); $ctRequest->submit_time = CTBody::SubmitTimeTest(); - $ctRequest->sender_info=json_encode(Array('page_url'=>htmlspecialchars(@$_SERVER['SERVER_NAME'].@$_SERVER['REQUEST_URI']))); + $ctRequest->sender_info=json_encode( + Array( + 'page_url' => htmlspecialchars(@$_SERVER['SERVER_NAME'].@$_SERVER['REQUEST_URI']), + 'REFFERRER' => $_SERVER['HTTP_REFERER'], + 'USER_AGENT' => $_SERVER['HTTP_USER_AGENT'], + ) + ); $ct = new Cleantalk(); $ct->server_url = $wgCTServerURL; @@ -231,7 +237,13 @@ public static function onAbortNewAccount ( $user, &$message ) { $ctRequest->sender_ip = $wgRequest->getIP(); $ctRequest->js_on = CTBody::JSTest(); $ctRequest->submit_time = CTBody::SubmitTimeTest(); - $ctRequest->sender_info=json_encode(Array('page_url'=>htmlspecialchars(@$_SERVER['SERVER_NAME'].@$_SERVER['REQUEST_URI']))); + $ctRequest->sender_info=json_encode( + Array( + 'page_url' => htmlspecialchars(@$_SERVER['SERVER_NAME'].@$_SERVER['REQUEST_URI']), + 'REFFERRER' => $_SERVER['HTTP_REFERER'], + 'USER_AGENT' => $_SERVER['HTTP_USER_AGENT'], + ) + ); $ct = new Cleantalk(); $ct->server_url = $wgCTServerURL;