aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2010-01-21 23:00:14 +0000
committerstuconnolly <stuart02@gmail.com>2010-01-21 23:00:14 +0000
commit7231dc45410e48621d2e67e77b8326e1210b2ae7 (patch)
treea63b4259aa5c1254f60b01077fd8af87760851e0
parenta395bb3a9501daa387b8e0c5a3a2959033d3450b (diff)
downloadsequelpro-7231dc45410e48621d2e67e77b8326e1210b2ae7.tar.gz
sequelpro-7231dc45410e48621d2e67e77b8326e1210b2ae7.tar.bz2
sequelpro-7231dc45410e48621d2e67e77b8326e1210b2ae7.zip
Trim leading and trailing whitespace and newlines from the host and SSH host input fields in the connection view. Fixes issue #545.
-rw-r--r--Source/SPConnectionController.m6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m
index 8acade5c..093d294e 100644
--- a/Source/SPConnectionController.m
+++ b/Source/SPConnectionController.m
@@ -204,6 +204,9 @@
if (delegate && [delegate respondsToSelector:@selector(connectionControllerInitiatingConnection:)]) {
[delegate connectionControllerInitiatingConnection:self];
}
+
+ // Trim whitespace and newlines from the host field before attempting to connect
+ [self setHost:[[self host] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]];
// Initiate the SSH connection process for tunnels
if ([self type] == SPSSHTunnelConnection) {
@@ -224,6 +227,9 @@
{
[progressIndicatorText setStringValue:NSLocalizedString(@"SSH connecting...", @"SSH connecting very short status message")];
[progressIndicatorText display];
+
+ // Trim whitespace and newlines from the SSH host field before attempting to connect
+ [self setSshHost:[[self sshHost] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]];
// Set up the tunnel details
sshTunnel = [[SPSSHTunnel alloc] initToHost:[self sshHost] port:([[self sshPort] length]?[[self sshPort] integerValue]:22) login:[self sshUser] tunnellingToPort:([[self port] length]?[[self port] integerValue]:3306) onHost:[self host]];