Advertisement
rlittl01

Untitled

Dec 3rd, 2014
18
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. --- a/src/webpage.cpp
  2. +++ b/src/webpage.cpp
  3. @@ -226,23 +226,26 @@
  4. doc += QL1S( "<h3>" );
  5. doc += i18n( "Details of the Request:" );
  6. doc += QL1S( "</h3><ul><li>" );
  7. - doc += i18n( "URL: %1", reqUrl.url() );
  8. + // escape URL twice: once for i18n, and once for HTML.
  9. + doc += i18n( "URL: %1", Qt::escape( Qt::escape( reqUrl.prettyUrl() ) ) );
  10. doc += QL1S( "</li><li>" );
  11.  
  12. const QString protocol (reqUrl.protocol());
  13. if ( !protocol.isNull() ) {
  14. - doc += i18n( "Protocol: %1", protocol );
  15. + // escape protocol twice: once for i18n, and once for HTML.
  16. + doc += i18n( "Protocol: %1", Qt::escape( Qt::escape( protocol ) ) );
  17. doc += QL1S( "</li><li>" );
  18. }
  19.  
  20. doc += i18n( "Date and Time: %1",
  21. KGlobal::locale()->formatDateTime(QDateTime::currentDateTime($
  22. doc += QL1S( "</li><li>" );
  23. - doc += i18n( "Additional Information: %1" , text );
  24. + // escape text twice: once for i18n, and once for HTML.
  25. + doc += i18n( "Additional Information: %1", Qt::escape( Qt::escape( text ) $
  26. doc += QL1S( "</li></ul><h3>" );
  27. doc += i18n( "Description:" );
  28. doc += QL1S( "</h3><p>" );
  29. - doc += description;
  30. + doc += Qt::escape( description );
  31. doc += QL1S( "</p>" );
  32.  
  33. if ( causes.count() ) {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement