PluginProbe
Fluent Support – Helpdesk & Customer Support Ticket System / 2.4.5
Fluent Support – Helpdesk & Customer Support Ticket System v2.4.5
2.4.5 2.4.0 2.3.2 2.3.1 2.3.0 2.2.1 2.2.0 trunk 1.10.0 1.10.1 1.10.2 1.10.3 1.10.4 1.10.5 1.4.0 1.4.1 1.4.2 1.4.5 1.4.6 1.4.7 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 All 69 releases
← All changes | app/Services/ThirdParty/HandleSlackEvent.php +4 -11 1.10.0 → 2.4.5 View file →
@@ -9,9 +9,8 @@
9 9 class HandleSlackEvent
10 10 {
11 11
12 12 /**
13 - * handleEvent method is responsible for handling slack events
14 13 * @param string $token
15 14 * @return bool
16 15 * @throws Exception
17 16 */
@@ -22,12 +21,8 @@
22 21 $this->validateToken($token);
23 22
24 23 $request = App::getInstance('request');
25 24
26 - if ($request->get('type') == 'url_verification') {
27 - echo wp_kses_post($request->get('challenge'));
28 - }
29 -
30 25 return (new SlackNotification())->processSlackEvent($request->get('event'));
31 26 }
32 27
33 28
@@ -32,11 +27,10 @@
32 27
33 28
34 29
35 30 /**
36 - * verifyProVersion method will check if the pro version is installed or not
37 31 * @throws Exception
38 - * @return boolean | Exception
32 + * @return bool
39 33 */
40 34 private function verifyProVersion ()
41 35 {
42 36 if (!defined('FLUENTSUPPORTPRO')) {
@@ -46,17 +40,16 @@
46 40 return true;
47 41 }
48 42
49 43 /**
50 - * validateToken method will check if the token is valid or not
51 44 * @param string $token
52 45 * @throws Exception
53 - * @return boolean | Exception
46 + * @return bool
54 47 */
55 48 private function validateToken ($token)
56 49 {
57 - if (\FluentSupportPro\App\Services\Integrations\Slack\SlackHelper::getWebhookToken() != $token) {
58 - throw new \Exception('Bot Token could not be verified', 404);
50 + if (!hash_equals(\FluentSupportPro\App\Services\Integrations\Slack\SlackHelper::getWebhookToken(), $token)) {
51 + throw new \Exception('Bot Token could not be verified', 403);
59 52 }
60 53 return true;
61 54 }
62 55 }