diff --git a/src/HotChocolate/Language/src/Language.Utf8/Utf8Helper.cs b/src/HotChocolate/Language/src/Language.Utf8/Utf8Helper.cs index b488a8c513c..ea88558e38b 100644 --- a/src/HotChocolate/Language/src/Language.Utf8/Utf8Helper.cs +++ b/src/HotChocolate/Language/src/Language.Utf8/Utf8Helper.cs @@ -26,7 +26,22 @@ public static void Unescape( { code = escapedString[++readPosition]; - if (code.IsValidEscapeCharacter()) + if (isBlockString && code == GraphQLConstants.Quote) + { + if (escapedString[readPosition + 1] == GraphQLConstants.Quote + && escapedString[readPosition + 2] == GraphQLConstants.Quote) + { + readPosition += 2; + unescapedString[writePosition++] = GraphQLConstants.Quote; + unescapedString[writePosition++] = GraphQLConstants.Quote; + unescapedString[writePosition++] = GraphQLConstants.Quote; + } + else + { + throw new Utf8EncodingException(Utf8Helper_InvalidQuoteEscapeCount); + } + } + else if (code.IsValidEscapeCharacter()) { if (code == GraphQLConstants.U) { @@ -137,4 +152,4 @@ private static int HexToDecimal(int a) _ => -1 }; } -} \ No newline at end of file +}