Skip to content

fix(mpris): sanitize metadata to prevent multiline UI expansion - #5225

Open
JuustKiwi wants to merge 1 commit into
Alexays:masterfrom
JuustKiwi:fix-mpris-newlines
Open

fix(mpris): sanitize metadata to prevent multiline UI expansion#5225
JuustKiwi wants to merge 1 commit into
Alexays:masterfrom
JuustKiwi:fix-mpris-newlines

Conversation

@JuustKiwi

Copy link
Copy Markdown
Contributor

What does this PR do?
I introduced a local sanitizer lambda in src/modules/mpris/mpris.cpp inside the getPlayerInfo() function. Before assigning the raw D-Bus C-strings to the PlayerInfo struct, the sanitizer converts them to std::string and uses std::replace to swap any \n or \r characters with standard spaces.

Related issues
Closes #4971

Checklist

  • [ x ] Code is formatted with clang-format
  • [ x ] Builds locally (ninja -C build)
  • Man page updated for any new/changed user-facing option (man/)
  • [ x ] Tested against the affected module(s)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MPRIS metadata containing newline characters (\n) causes Waybar to expand to multiple lines

1 participant