Fix sharing files with spaces or quotes in names via Telegram
Needs ReviewPublic

Authored by mikhailru on Fri, Feb 8, 2:55 PM.

Details

Reviewers
apol
Summary

At present, when one tries to share files with
certain names via Telegram using Dolphin's share menu,
Dolphin crashes (names contain unbalanced quotes) or a wrong
name is passed to Telegram (names with spaces). The root cause
is KShell::splitArgs returning empty QStringList or doing
wrong splits for the above classes of names. This patch
postpones the substitution of "%u" with the actual filename
until splitting is done, thus avoiding undesired behavior.

Test Plan
  1. Create test files:

$ echo test | tee test\ .txt | tee test\'.txt > test\".txt

  1. Start Dolphin and share the files via Telegram.
  1. No errors and crashes should occur in the process.

Diff Detail

Repository
R495 Purpose Library
Branch
telegram-sharing-fix (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 8032
Build 8050: arc lint + arc unit
mikhailru created this revision.Fri, Feb 8, 2:55 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptFri, Feb 8, 2:55 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
mikhailru requested review of this revision.Fri, Feb 8, 2:55 PM

Should they really be joined? It seems like this will fail with more than one url.

I'd suggest changing arrayToList to provide quoted urls.