Review Request: Fix sanitization of dbus path in KMainWindow

Thomas Lübking thomas.luebking at web.de
Mon Aug 17 21:20:57 BST 2009


Am Monday 17 August 2009 schrieb Matthew Woehlke:
> If you'd like to "one-up" my patch, please feel free :-). Otherwise I'm
> not sure what you have in mind.
i guess sth. like

QRegExp identifier("[A-Za-z0-9_]");
o.objectName().mid(i,1).contains(identifier);

Performance ain't crucial here (and QChar::isLetter() just tests some flags), 
but i just tested and QChar grants ::isLetter to really a lot of stuff (esp. 
as any utf-8 char seems to be split an the first part becomes a letter, though 
it's /no/ [A-Za-z] :-(

(new test code attached)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: objectnametest.cc
Type: text/x-c++src
Size: 433 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20090817/d1c57e6c/attachment.cc>


More information about the kde-core-devel mailing list