aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPConnectionControllerDelegate.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2011-08-07 18:42:51 +0000
committerstuconnolly <stuart02@gmail.com>2011-08-07 18:42:51 +0000
commitd01474532b11014019d4d5a1197a8f8f7d683c0b (patch)
treefc22b25c8ba23b21490673b416ce9064c77ed524 /Source/SPConnectionControllerDelegate.m
parent8a77a195fa6ce3aad15857a2213011bf0e8d7bd5 (diff)
downloadsequelpro-d01474532b11014019d4d5a1197a8f8f7d683c0b.tar.gz
sequelpro-d01474532b11014019d4d5a1197a8f8f7d683c0b.tar.bz2
sequelpro-d01474532b11014019d4d5a1197a8f8f7d683c0b.zip
Don't allow newlines in the connection view input fields. Fixes issue #1008.
Diffstat (limited to 'Source/SPConnectionControllerDelegate.m')
-rw-r--r--Source/SPConnectionControllerDelegate.m6
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/SPConnectionControllerDelegate.m b/Source/SPConnectionControllerDelegate.m
index 63f58ace..7d461233 100644
--- a/Source/SPConnectionControllerDelegate.m
+++ b/Source/SPConnectionControllerDelegate.m
@@ -44,6 +44,8 @@ static NSString *SPDatabaseImage = @"database-small";
- (void)_reloadFavoritesViewData;
- (void)_updateFavoritePasswordsFromField:(NSControl *)control;
+- (NSString *)_stripInvalidCharactersFromString:(NSString *)subject;
+
@end
@implementation SPConnectionController (SPConnectionControllerDelegate)
@@ -274,7 +276,9 @@ static NSString *SPDatabaseImage = @"database-small";
- (void)controlTextDidChange:(NSNotification *)notification
{
id field = [notification object];
-
+
+ [field setStringValue:[self _stripInvalidCharactersFromString:[field stringValue]]];
+
if (((field == standardNameField) || (field == socketNameField) || (field == sshNameField)) && [self selectedFavoriteNode]) {
favoriteNameFieldWasTouched = YES;