From a485d370c24cb6378a52c3452dc0cdbadfefd50f Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Wed, 20 Jan 2010 23:51:15 +0000 Subject: Address Issue #546 (format string bugs): - Fix incorrect uses of [NSString stringWithFormat:] with preconstructed strings and no arguments in SPUserManager - To fix display issues, replace NSBeginAlertSheet (which includes automatic sprintf expansion of the message) with a safely-escaped SPBeginAlertSheet in many files --- Source/SPExtendedTableInfo.m | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'Source/SPExtendedTableInfo.m') diff --git a/Source/SPExtendedTableInfo.m b/Source/SPExtendedTableInfo.m index 8b414219..88c91981 100644 --- a/Source/SPExtendedTableInfo.m +++ b/Source/SPExtendedTableInfo.m @@ -30,6 +30,7 @@ #import "SPStringAdditions.h" #import "SPConstants.h" #import "TableDocument.h" +#import "SPAlertSheets.h" @interface SPExtendedTableInfo (PrivateAPI) @@ -106,7 +107,7 @@ else { [sender selectItemWithTitle:currentType]; - NSBeginAlertSheet(NSLocalizedString(@"Error changing table type", @"error changing table type message"), + SPBeginAlertSheet(NSLocalizedString(@"Error changing table type", @"error changing table type message"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [NSApp mainWindow], self, nil, nil, nil, [NSString stringWithFormat:NSLocalizedString(@"An error occurred when trying to change the table type to '%@'.\n\nMySQL said: %@", @"error changing table type informative message"), newType, [connection getLastErrorMessage]]); } @@ -135,7 +136,7 @@ else { [sender selectItemWithTitle:currentEncoding]; - NSBeginAlertSheet(NSLocalizedString(@"Error changing table encoding", @"error changing table encoding message"), + SPBeginAlertSheet(NSLocalizedString(@"Error changing table encoding", @"error changing table encoding message"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [NSApp mainWindow], self, nil, nil, nil, [NSString stringWithFormat:NSLocalizedString(@"An error occurred when trying to change the table encoding to '%@'.\n\nMySQL said: %@", @"error changing table encoding informative message"), newEncoding, [connection getLastErrorMessage]]); } @@ -164,7 +165,7 @@ else { [sender selectItemWithTitle:currentCollation]; - NSBeginAlertSheet(NSLocalizedString(@"Error changing table collation", @"error changing table collation message"), + SPBeginAlertSheet(NSLocalizedString(@"Error changing table collation", @"error changing table collation message"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [NSApp mainWindow], self, nil, nil, nil, [NSString stringWithFormat:NSLocalizedString(@"An error occurred when trying to change the table collation to '%@'.\n\nMySQL said: %@", @"error changing table collation informative message"), newCollation, [connection getLastErrorMessage]]); } @@ -352,7 +353,7 @@ [self reloadTable:self]; } else { - NSBeginAlertSheet(NSLocalizedString(@"Error changing table comment", @"error changing table comment message"), + SPBeginAlertSheet(NSLocalizedString(@"Error changing table comment", @"error changing table comment message"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [NSApp mainWindow], self, nil, nil, nil, [NSString stringWithFormat:NSLocalizedString(@"An error occurred when trying to change the table's comment to '%@'.\n\nMySQL said: %@", @"error changing table comment informative message"), newComment, [connection getLastErrorMessage]]); } -- cgit v1.2.3