From e3c7c2556246d4ff609ed593811f8909f27bba20 Mon Sep 17 00:00:00 2001 From: Mark Friedrich Date: Sat, 17 Feb 2018 13:35:37 +0100 Subject: [PATCH] added new subDomain to valid list for Discord WebHooks, closed #578 --- app/main/model/mapmodel.php | 6 +++--- public/templates/dialog/map.html | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/main/model/mapmodel.php b/app/main/model/mapmodel.php index 9d5a4c94..6e14b0da 100644 --- a/app/main/model/mapmodel.php +++ b/app/main/model/mapmodel.php @@ -377,13 +377,13 @@ class MapModel extends AbstractMapTrackingModel { $valid = true; if( !empty($val) ){ $hosts = [ - 'slack' => 'hooks.slack.com', - 'discord' => 'discordapp.com' + 'slack' => ['hooks.slack.com'], + 'discord' => ['discordapp.com', 'ptb.discordapp.com'] ]; if( !\Audit::instance()->url($val) || - parse_url($val, PHP_URL_HOST) !== $hosts[$type] + !in_array(parse_url($val, PHP_URL_HOST), $hosts[$type]) ){ $valid = false; $this->throwValidationException($key); diff --git a/public/templates/dialog/map.html b/public/templates/dialog/map.html index 30f96d3d..8358f3d6 100644 --- a/public/templates/dialog/map.html +++ b/public/templates/dialog/map.html @@ -227,7 +227,7 @@