Ensure that no extra bits can leak into QUrl::toEncoded.

Technically, this function should take QUrl::UrlFormattingOptions, but
that doesn't exist. So we just mask out the high bits that determine
the encoding options. toEncoded only supports one encoding way: fully
encoded.

Change-Id: I1445ad7c292500921ec2672be4524d7d76a39f98
Reviewed-by: David Faure <faure@kde.org>
This commit is contained in:
Thiago Macieira 2012-05-22 15:16:01 +02:00 committed by Qt by Nokia
parent d921182310
commit 7590ca03ce

View File

@ -2486,7 +2486,7 @@ QString QUrl::toDisplayString(FormattingOptions options) const
*/
QByteArray QUrl::toEncoded(FormattingOptions options) const
{
options &= ~DecodeReserved;
options &= ~(FullyDecoded | FullyEncoded);
QString stringForm = toString(options | FullyEncoded);
return stringForm.toLatin1();
}