adium-1.4 2945:7eed15863815: Don't allow spaces in the variant n...

commits at adium.im commits at adium.im
Wed May 12 17:37:16 UTC 2010


details:	http://hg.adium.im/adium-1.4/rev/7eed15863815
revision:	2945:7eed15863815
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
(transplanted from 41a9e7637f5bab5617946b8bf857f61c009656c7)

diffs (33 lines):

diff -r 6748e5dd6ce5 -r 7eed15863815 Plugins/WebKit Message View/AIWebkitMessageViewStyle.m
--- a/Plugins/WebKit Message View/AIWebkitMessageViewStyle.m	Wed May 12 06:59:21 2010 -0600
+++ b/Plugins/WebKit Message View/AIWebkitMessageViewStyle.m	Wed May 12 12:36:43 2010 -0500
@@ -866,8 +866,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]]) {
@@ -1292,9 +1295,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