<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Jan 28, 2015 at 7:13 PM, ChALkeR <span dir="ltr"><<a href="mailto:chalkerx@gmail.com" target="_blank">chalkerx@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Atm, the core of ktp-text-ui is trying hard to escape things, parse links and auto-convert them, embed videos and bugzilla info, etc.<div><br></div><div>And the new default style breaks it all with careless innerHTML unescaping and post-processing.</div><div>For example, line</div><div>./data/styles/WoshiChat.AdiumMessageStyle/Contents/Resources/Footer.html:24: messageNode.innerHTML = rawMessage.replace(/(@"*[\d\w]*)/, '<span class="atTag">$1</span>');</div><div>Breaks messages with @ in links, try «<a href="http://foo@example.org" target="_blank">http://foo@example.org</a>».</div></div></blockquote><div><br></div><div>Fixed.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Html unescaping in line</div><div>./data/styles/WoshiChat.AdiumMessageStyle/Contents/Resources/Footer.html:22: rawMessage = scrubHTML(rawMessage);<br>makes things like «<div style="position:absolute;left:0;right:0;top:0;bottom:0" onmouseover="window.location='http://' + '<a href="http://kde.org" target="_blank">kde.org</a>'"></div>» possible (replace <a href="http://kde.org" target="_blank">kde.org</a> with some random site). Btw, that makes it easy to crash the chat.</div></div></blockquote><div><br></div><div>Also fixed.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Aside from the fact that the abovementioned behaviour is bad by itself, that in-style-postprocessing behaviour is inconsistent between styles, which could be unexpected by users, and is inconsistent with built-in message filters.<br><br></div><div>IMO, all the innerHTML post-processing should be stripped of all bundled styles, and no such «features» should be bundled inside styles. Can anyone comment on this, please?</div></div></blockquote><div><br></div><div>I've removed the whole scrubHTML function of that style.</div></div><div><br></div><div>Cheers</div>-- <br><div class="gmail_signature"><div><span style="color:rgb(102,102,102)">Martin Klapetek | KDE Developer</span></div></div>
</div></div>