Merge pull request #15909 from luiscuenca/WLtrimSpaces

BUGZ-656: Trim spaces for orgname and username fields on Windows Launcher
This commit is contained in:
Shannon Romano 2019-07-10 17:17:29 -07:00 committed by GitHub
commit 2dfc03ea47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,6 +9,7 @@
//
#include "stdafx.h"
#include <regex>
#include "LauncherApp.h"
#include "LauncherDlg.h"
@ -268,7 +269,10 @@ afx_msg void CLauncherDlg::OnNextClicked() {
m_orgname.GetWindowTextW(orgname);
m_username.GetWindowTextW(username);
m_password.GetWindowTextW(password);
// trim spaces
orgname = CString(std::regex_replace(LauncherUtils::cStringToStd(orgname), std::regex("^ +| +$|( ) +"), "$1").c_str());
username = CString(std::regex_replace(LauncherUtils::cStringToStd(username), std::regex("^ +| +$|( ) +"), "$1").c_str());
// encode
username = LauncherUtils::urlEncodeString(username);
password = LauncherUtils::urlEncodeString(password);
LauncherUtils::ResponseError error;