adium 3191:41a9e7637f5b: Don't allow spaces in the variant name ...

commits at adium.im commits at adium.im
Wed May 12 17:36:47 UTC 2010


details:	http://hg.adium.im/adium/rev/41a9e7637f5b
revision:	3191:41a9e7637f5b
author:		Evan Schoenberg
date:		Wed May 12 12:36:43 2010 -0500

Don't allow spaces in the variant name when replacing %variant% keywords; replace them with an underscore (_). Fixes #12702

diffs (33 lines):

diff -r 3a59318c49f6 -r 41a9e7637f5b Plugins/WebKit Message View/AIWebkitMessageViewStyle.m
--- a/Plugins/WebKit Message View/AIWebkitMessageViewStyle.m	Tue May 11 20:39:36 2010 -0700
+++ b/Plugins/WebKit Message View/AIWebkitMessageViewStyle.m	Wed May 12 12:36:43 2010 -0500
@@ -884,8 +884,11 @@
 				  withString:[AIServiceIcons pathForServiceIconForServiceID:content.chat.account.service.serviceID
 																	   type:AIServiceIconLarge]];
 
-	[inString replaceKeyword:@"%variant%"
-				  withString:self.activeVariant];
+	if ([inString rangeOfString:@"%variant%"].location != NSNotFound) {
+		/* Per #12702, don't allow spaces in the variant name, as otherwise it becomes multiple css classes */
+		[inString replaceKeyword:@"%variant%"
+					  withString:[self.activeVariant stringByReplacingOccurrencesOfString:@" " withString:@"_"]];
+	}
 
 	//message stuff
 	if ([content isKindOfClass:[AIContentMessage class]]) {
@@ -1310,9 +1313,12 @@
  		}
  	}
 	
-	[inString replaceKeyword:@"%variant%"
-				  withString:self.activeVariant];
-
+	if ([inString rangeOfString:@"%variant%"].location != NSNotFound) {
+		/* Per #12702, don't allow spaces in the variant name, as otherwise it becomes multiple css classes */
+		[inString replaceKeyword:@"%variant%"
+					  withString:[self.activeVariant stringByReplacingOccurrencesOfString:@" " withString:@"_"]];
+	}
+	
 	return inString;
 }
 




More information about the commits mailing list