Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.

Commit 2a74f57

Browse files
author
Gerardo Pacheco
authored
Merge pull request #537 from wordpress-mobile/crash/xml-rpc-media-sizes
XML-RPC: Use stringForKeyPath when accessing image sizes from remote metadata
2 parents ed78f15 + 7634f39 commit 2a74f57

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

WordPressKit.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Pod::Spec.new do |s|
44
s.name = 'WordPressKit'
5-
s.version = '4.57.0'
5+
s.version = '4.57.1'
66

77
s.summary = 'WordPressKit offers a clean and simple WordPress.com and WordPress.org API.'
88
s.description = <<-DESC

WordPressKit/MediaServiceRemoteXMLRPC.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,12 +273,12 @@ - (RemoteMedia *)remoteMediaFromXMLRPCDictionary:(NSDictionary*)xmlRPC
273273
}
274274
remoteMedia.file = [link lastPathComponent] ?: [[xmlRPC objectForKeyPath:@"file"] lastPathComponent];
275275

276-
if ([xmlRPC valueForKeyPath:@"metadata.sizes.large.file"] != nil) {
277-
remoteMedia.largeURL = [NSURL URLWithString: [NSString stringWithFormat:@"%@%@", remoteMedia.url.URLByDeletingLastPathComponent, [xmlRPC valueForKeyPath:@"metadata.sizes.large.file"]]];
276+
if ([xmlRPC stringForKeyPath:@"metadata.sizes.large.file"] != nil) {
277+
remoteMedia.largeURL = [NSURL URLWithString: [NSString stringWithFormat:@"%@%@", remoteMedia.url.URLByDeletingLastPathComponent, [xmlRPC stringForKeyPath:@"metadata.sizes.large.file"]]];
278278
}
279279

280-
if ([xmlRPC valueForKeyPath:@"metadata.sizes.medium.file"] != nil) {
281-
remoteMedia.mediumURL = [NSURL URLWithString: [NSString stringWithFormat:@"%@%@", remoteMedia.url.URLByDeletingLastPathComponent, [xmlRPC valueForKeyPath:@"metadata.sizes.medium.file"]]];
280+
if ([xmlRPC stringForKeyPath:@"metadata.sizes.medium.file"] != nil) {
281+
remoteMedia.mediumURL = [NSURL URLWithString: [NSString stringWithFormat:@"%@%@", remoteMedia.url.URLByDeletingLastPathComponent, [xmlRPC stringForKeyPath:@"metadata.sizes.medium.file"]]];
282282
}
283283

284284
if (xmlRPC[@"date_created_gmt"] != nil) {

0 commit comments

Comments
 (0)