diff --git a/src/QrCode.cpp b/src/QrCode.cpp index 64b57657..cc8327a6 100644 --- a/src/QrCode.cpp +++ b/src/QrCode.cpp @@ -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 ) {