From 28a5469e25229ee0b922c7cd976cf510b73b5c7d Mon Sep 17 00:00:00 2001 From: heper Date: Wed, 16 Jan 2019 11:24:43 +0100 Subject: [PATCH 1/2] add trim() to $_POST['auth_user'] & $_POST['auth_user2'] --- src/usr/local/captiveportal/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/usr/local/captiveportal/index.php b/src/usr/local/captiveportal/index.php index b213d4b0c2..526b142532 100644 --- a/src/usr/local/captiveportal/index.php +++ b/src/usr/local/captiveportal/index.php @@ -189,11 +189,11 @@ EOD; $passwd = $cpcfg['radmac_secret']; $context = 'radmac'; // Radius MAC authentication } elseif (!empty($_POST['auth_user2'])) { - $user = $_POST['auth_user2']; + $user = trim($_POST['auth_user2']); $passwd = $_POST['auth_pass2']; $context = 'second'; // Assume users to use the first context if auth_user2 is empty/does not exist } else { - $user = $_POST['auth_user']; + $user = trim($_POST['auth_user']); $passwd = $_POST['auth_pass']; $context = 'first'; } From d6601c8f0012f8eb784a285636ba9cca19d37f89 Mon Sep 17 00:00:00 2001 From: Augustin-FL Date: Mon, 4 Feb 2019 22:45:57 +0100 Subject: [PATCH 2/2] Also trim if() statement --- src/usr/local/captiveportal/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/usr/local/captiveportal/index.php b/src/usr/local/captiveportal/index.php index 526b142532..d5459a8097 100644 --- a/src/usr/local/captiveportal/index.php +++ b/src/usr/local/captiveportal/index.php @@ -188,7 +188,7 @@ EOD; $user = $clientmac; $passwd = $cpcfg['radmac_secret']; $context = 'radmac'; // Radius MAC authentication - } elseif (!empty($_POST['auth_user2'])) { + } elseif (!empty(trim($_POST['auth_user2']))) { $user = trim($_POST['auth_user2']); $passwd = $_POST['auth_pass2']; $context = 'second'; // Assume users to use the first context if auth_user2 is empty/does not exist