[k-c-i] Fix escape/url filter URL placeholder backward substitution
ClosedPublic

Authored by akulichalexandr on Mar 2 2019, 3:13 PM.

Details

Summary

The placeholder ends with a decimal URL index. The substitution is an incremental pass from zero index, so when the placeholder is substituted back to URL the replacing code matches incomplete index and we got a messed URLs.

E.g. we replace placeholder #K#T#P1 and it actually mess up #K#T#P10 and #K#T#P11

Add a end marker to the placeholder scheme to never mess URL.
An alternative solution is to reverse the backward substitutions but meh. :)

BUG: 384968
FIXED-IN: 18.12.3

Test Plan

I took the testcase from the bugreport.

Test message:

Test
http://01.org/
http://02.org/
http://03.org/
http://04.org/
http://05.org/
http://06.org/
http://07.org/
http://08.org/
http://09.org/
http://10.org/
http://11.org/
http://12.org/
http://13.org/
http://14.org/

What KDE Telepathy used to display:

Test
http://01.org/
http://02.org/
http://03.org/
http://04.org/
http://05.org/
http://06.org/
http://07.org/
http://08.org/
http://09.org/
http://10.org/
http://02.org/0
http://02.org/1
http://02.org/2
http://02.org/3

What KTp displays with the fix:

Test
http://01.org/
http://02.org/
http://03.org/
http://04.org/
http://05.org/
http://06.org/
http://07.org/
http://08.org/
http://09.org/
http://10.org/
http://11.org/
http://12.org/
http://13.org/
http://14.org/

Diff Detail

Repository
R145 KDE Telepathy Common Internals
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
akulichalexandr requested review of this revision.Mar 2 2019, 3:13 PM
akulichalexandr created this revision.
akulichalexandr edited the summary of this revision. (Show Details)Mar 2 2019, 3:16 PM
This revision was not accepted when it landed; it landed in state Needs Review.Mar 3 2019, 10:46 PM
This revision was automatically updated to reflect the committed changes.