Trim spaces on orgname and username

This commit is contained in:
luiscuenca 2019-07-10 15:45:14 -07:00
parent ebfbe46760
commit c8ed1e369d
No known key found for this signature in database
GPG key ID: 2387ECD129A6961D

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;