Skip to content

Commit 2b8156e

Browse files
committed
[Info Plist] Auto format XML escapes
Automatically format any XML escapes of file type association names. Adjust Info.plist to account for this change. Signed-off-by: Christopher Snowhill <kode54@gmail.com>
1 parent d59b533 commit 2b8156e

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

Audio/PluginController.mm

+11-1
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,16 @@ - (void)setupSource:(NSString *)className {
348348
}
349349
}
350350

351+
static NSString *xmlEscapeString(NSString * string) {
352+
CFStringRef textXML = CFXMLCreateStringByEscapingEntities(kCFAllocatorDefault, (CFStringRef)string, nil);
353+
if(textXML) {
354+
NSString *textString = (__bridge NSString *)textXML;
355+
CFRelease(textXML);
356+
return textString;
357+
}
358+
return @"";
359+
}
360+
351361
- (void)printPluginInfo {
352362
ALog(@"Sources: %@", self.sources);
353363
ALog(@"Containers: %@", self.containers);
@@ -504,7 +514,7 @@ - (void)printPluginInfo {
504514
\t\t\t<integer>1</integer>\n\
505515
\t\t\t<key>CFBundleTypeName</key>\n\
506516
\t\t\t<string>"];
507-
[stringList addObject:[type objectAtIndex:0]];
517+
[stringList addObject:xmlEscapeString([type objectAtIndex:0])];
508518
[stringList addObject:@"</string>\n\
509519
\t\t\t<key>CFBundleTypeRole</key>\n\
510520
\t\t\t<string>Viewer</string>\n\

Info.plist

+1-1
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,7 @@
825825
<key>CFBundleTypeIconSystemGenerated</key>
826826
<integer>1</integer>
827827
<key>CFBundleTypeName</key>
828-
<string>Monkey's Audio File</string>
828+
<string>Monkey&apos;s Audio File</string>
829829
<key>CFBundleTypeRole</key>
830830
<string>Viewer</string>
831831
<key>LSHandlerRank</key>

Plugins/Hively/Hively/HVLDecoder.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ + (NSArray *)fileTypes {
185185
+ (NSArray *)fileTypeAssociations {
186186
return @[
187187
@[@"Hively Tracker File", @"song.icns", @"hvl"],
188-
@[@"Abyss&apos; Highest eXperience File", @"song.icns", @"ahx"]
188+
@[@"Abyss' Highest eXperience File", @"song.icns", @"ahx"]
189189
];
190190
}
191191

0 commit comments

Comments
 (0)