[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: Review Request: Fix sanitization of dbus path in KMainWindow
From:       Matthew Woehlke <mw_triad () users ! sourceforge ! net>
Date:       2009-08-17 22:17:11
Message-ID: h6ckt8$c6a$1 () ger ! gmane ! org
[Download RAW message or body]

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...)

-- 
Matthew
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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic