summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorIvan Solovev <ivan.solovev@qt.io>2023-02-22 15:41:59 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-02-23 21:00:25 +0000
commitd61addabefc8afc3b6211eaecee1fa0ec828fc36 (patch)
tree0b0a04141d2d7f5575d2d076954a7235866500bc /examples
parent760cd4371068e8f9fb0d0d2f78f9bb0c3ba85791 (diff)
SDP scanner: encode input URLs and escape XML-specific characters6.4
The old implementation didn't take care of escaping the XML-specific characters and didn't handle non-printable characters. This patch makes use of QUrl class to properly %-encode the input data. The QUrl::toEncoded() method %-encodes all XML-specific characters except '&', so we need to manually replace it with "&amp;" before adding the url to the generated XML. Escaping special XML characters potentially allows Qt Bluetooth to handle more URLs received from sdpscanner, because QXmlStreamReader discards attributes with unescaped special characters, so previously part of the URLs could be silently skipped. For other potential sdpscanner users this change shouldn't make much difference, because they should anyway parse the returned XML documents according to XML standard. %-encoding of URLs potentially changes the way the URL looks for the user, but not for the software that should handle the URLs, so this change is also safe. [ChangeLog][Qt Bluetooth][sdpscanner] sdpscanner now %-encodes the URLs and escapes all XML-specific characters in them before adding the result to the generated XML output. Fixes: QTBUG-111369 Change-Id: I6de080fef7689ef96fe5e5e26c62a3c48ebc45b7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit d195ae3a07dcd3fceeb70554ed9493f55ef50c86) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'examples')
0 files changed, 0 insertions, 0 deletions