Skip to content

Commit

Permalink
Fix copying URLs to clipboard from QR dialog (URL string wasn't prope…
Browse files Browse the repository at this point in the history
…rly escaped).
  • Loading branch information
wcjohns committed Aug 13, 2023
1 parent 83eaf12 commit 7f6d7fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/QrCode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -389,11 +389,11 @@ SimpleDialog *displayTxtAsQrCode( const std::string &url,
copyBtn->setFloatSide( Wt::Side::Left );

// TODO: there is probably a way to get wApp->root()->id() directly in the JS
const string escaped_url = WString(url).jsStringLiteral();
copyBtn->clicked().connect( "function(s,e){ "
"Wt.WT.CopyUrlToClipboard(s,e,'" + copyBtn->id() + "','" + wApp->root()->id() + "','" + url + "');"
"Wt.WT.CopyUrlToClipboard(s,e,'" + copyBtn->id() + "','" + wApp->root()->id() + "'," + escaped_url + ");"
"}" );


return window;
}catch( std::exception &e )
{
Expand Down

0 comments on commit 7f6d7fc

Please sign in to comment.