From fa97fb6653aad6c3d530f10e669460b82f785da6 Mon Sep 17 00:00:00 2001 From: Tim Date: Thu, 30 Aug 2018 00:08:22 +0200 Subject: [PATCH] Fixed rdp:// bug and fixed port not updating #418 (#629) - Although the port isn't used while testing a website, changing it prevents confusion. - Fix bug that made it impossible to check rdp:// as it would add http:// in front of it. --- CHANGELOG.rst | 1 + src/psm/Module/Server/Controller/ServerController.php | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index da896765..98c09028 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -5,6 +5,7 @@ Changelog Not yet released ---------------- +#629: Fix bug that made it impossible to check rdp:// and fixed port update. b49659f: Added question to notification faq about not recieving notifications. ef28908: Indentation fix. #605: Added Norwegian language. diff --git a/src/psm/Module/Server/Controller/ServerController.php b/src/psm/Module/Server/Controller/ServerController.php index 0a919f98..fdeed658 100644 --- a/src/psm/Module/Server/Controller/ServerController.php +++ b/src/psm/Module/Server/Controller/ServerController.php @@ -278,15 +278,15 @@ class ServerController extends AbstractServerController { 'telegram' => in_array($_POST['telegram'], array('yes', 'no')) ? $_POST['telegram'] : 'no', ); // make sure websites start with http:// - if ($clean['type'] == 'website' && substr($clean['ip'], 0, 4) != 'http') { + if ($clean['type'] == 'website' && substr($clean['ip'], 0, 4) != 'http' && substr($clean['ip'], 0, 3) != 'rdp') { $clean['ip'] = 'http://'.$clean['ip']; } // validate the lot $server_validator = new \psm\Util\Server\ServerValidator($this->db); - // format port from http/s url - if ($clean['type'] == 'website' && empty($clean['port'])) { + // format port from http, https or rdp url + if ($clean['type'] == 'website') { $tmp = parse_url($clean["ip"]); if (isset($tmp["port"])) { $clean["port"] = $tmp["port"];