From 9e13a6aeae1a2a0259f926cf3c0d4db284d04315 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 15 Aug 2019 14:32:31 +0900 Subject: [PATCH 1/2] Fix newlines being considered in user profile content --- osu.Game/Overlays/Profile/Header/BottomHeaderContainer.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game/Overlays/Profile/Header/BottomHeaderContainer.cs b/osu.Game/Overlays/Profile/Header/BottomHeaderContainer.cs index e7f7c2f490..691e18e6bf 100644 --- a/osu.Game/Overlays/Profile/Header/BottomHeaderContainer.cs +++ b/osu.Game/Overlays/Profile/Header/BottomHeaderContainer.cs @@ -138,6 +138,9 @@ namespace osu.Game.Overlays.Profile.Header private void tryAddInfo(IconUsage icon, string content, string link = null) { + // newlines could be contained in API returned user content. + content = content?.Replace("\n", " "); + if (string.IsNullOrEmpty(content)) return; bottomLinkContainer.AddIcon(icon, text => From 8f638879728bff8c8812253ba24476d7721e176d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 15 Aug 2019 14:38:49 +0900 Subject: [PATCH 2/2] Make use of existing null check --- osu.Game/Overlays/Profile/Header/BottomHeaderContainer.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Overlays/Profile/Header/BottomHeaderContainer.cs b/osu.Game/Overlays/Profile/Header/BottomHeaderContainer.cs index 691e18e6bf..158641d816 100644 --- a/osu.Game/Overlays/Profile/Header/BottomHeaderContainer.cs +++ b/osu.Game/Overlays/Profile/Header/BottomHeaderContainer.cs @@ -138,11 +138,11 @@ namespace osu.Game.Overlays.Profile.Header private void tryAddInfo(IconUsage icon, string content, string link = null) { - // newlines could be contained in API returned user content. - content = content?.Replace("\n", " "); - if (string.IsNullOrEmpty(content)) return; + // newlines could be contained in API returned user content. + content = content.Replace("\n", " "); + bottomLinkContainer.AddIcon(icon, text => { text.Font = text.Font.With(size: 10);