Review Request: Fix sanitization of dbus path in KMainWindow

Matthew Woehlke mw_triad at
Mon Aug 17 23:17:11 BST 2009

Thiago Macieira wrote:
> Thomas L├╝bking wrote:
>> 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)
> No need for QRegExp. Just iterate over the string and change the 
> characters that aren't A-Z, a-z, 0-9 and underscore.

Would you be willing to proffer a patch? My interest level is, alas, 
waning... especially with the oddness Thomas is pointing out. (Anyway 
isLetter() shouldn't be any worse than isLetterOrNumber(), so at least I 
don't think we are regressing...)

Please do not quote my e-mail address unobfuscated in message bodies.
Some people are like Slinkies... not really good for anything, but they 
still bring a smile to your face when you push them down a flight of 
stairs. -- Gordon Wolfe

More information about the kde-core-devel mailing list