From f85f0e656151fec8e0bed0ae3547463443bbf226 Mon Sep 17 00:00:00 2001 From: Mike Abdullah Date: Wed, 28 Jan 2015 18:00:27 +0000 Subject: [PATCH] Disable IFUnicode fallback when interpreting arbitrary strings Crashes in case https://karelia.fogbugz.com/f/cases/252798 --- KSEncodeURLString.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/KSEncodeURLString.m b/KSEncodeURLString.m index a1b21cf..a3303b0 100644 --- a/KSEncodeURLString.m +++ b/KSEncodeURLString.m @@ -42,11 +42,16 @@ - (id)transformedValue:(id)value; NSURL *result = [WebView URLFromPasteboard:pboard]; - // Fallback to IFUnicodeURL + // We were falling back to IFUnicodeURL if WebKit was unable to help. However, we found in case + // https://karelia.fogbugz.com/f/cases/252798 this crashes on the string: + // Complete summer class schedule! Fairytale ballet camps for ages 3-5, Intro to Ballet program for ages 5-9, Pre-Intensive for ages 6- + // Why? Who knows! +#if FALLBACK_TO_IFUNICODE if (!result && [value isKindOfClass:[NSString class]] && [value length]) { result = [NSURL URLWithUnicodeString:value]; } +#endif return result; }