desktop/qa/desktop_app/test_desktop_app.cxx | 2 +- desktop/source/app/cmdlineargs.cxx | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-)
New commits: commit f6dc5636c1eda8aebeac3f7b85dd61499523d6a3 Author: Tamás Zolnai <tamas.zol...@collabora.com> AuthorDate: Wed Apr 17 12:33:13 2019 +0200 Commit: Tamás Zolnai <tamas.zol...@collabora.com> CommitDate: Wed Apr 17 23:36:58 2019 +0200 SharePoint connection: Better handling of encoded URLs Handle %7c with small letters. Make sure that the output parameter's content is not affected by decoding. Change-Id: Ie3faad2461815497c0edfb04a589fc57aeb7d66b Reviewed-on: https://gerrit.libreoffice.org/70873 Tested-by: Jenkins Reviewed-by: Tamás Zolnai <tamas.zol...@collabora.com> diff --git a/desktop/qa/desktop_app/test_desktop_app.cxx b/desktop/qa/desktop_app/test_desktop_app.cxx index 055c8cf5434e..1a027dfade78 100644 --- a/desktop/qa/desktop_app/test_desktop_app.cxx +++ b/desktop/qa/desktop_app/test_desktop_app.cxx @@ -113,7 +113,7 @@ void Test::testTdf100837() { { // 3. Test enocded URLs - TestSupplier supplier{ "foo", "ms-word:ofe%7Cu%7Cbar1", "ms-word:ofv%7Cu%7Cbar2", "ms-word:nft%7Cu%7Cbar3", "baz" }; + TestSupplier supplier{ "foo", "ms-word:ofe%7Cu%7cbar1", "ms-word:ofv%7cu%7Cbar2", "ms-word:nft%7Cu%7cbar3", "baz" }; desktop::CommandLineArgs args(supplier); auto vOpenList = args.GetOpenList(); auto vForceOpenList = args.GetForceOpenList(); diff --git a/desktop/source/app/cmdlineargs.cxx b/desktop/source/app/cmdlineargs.cxx old mode 100755 new mode 100644 index acb266eb335e..30d0c3f4cced --- a/desktop/source/app/cmdlineargs.cxx +++ b/desktop/source/app/cmdlineargs.cxx @@ -131,25 +131,25 @@ CommandLineEvent CheckOfficeURI(/* in,out */ OUString& arg, CommandLineEvent cur long nURIlen = -1; // URL might be encoded - rest1 = rest1.replaceAll("%7C", "|"); + OUString decoded_rest = rest1.replaceAll("%7C", "|").replaceAll("%7c", "|"); // 2. Discriminate by command name (incl. 1st command argument descriptor) // Extract URI: everything up to possible next argument - if (rest1.startsWith("ofv|u|", &rest2)) + if (decoded_rest.startsWith("ofv|u|", &rest2)) { // Open for view - override only in default mode if (curEvt == CommandLineEvent::Open) curEvt = CommandLineEvent::View; nURIlen = rest2.indexOf("|"); } - else if (rest1.startsWith("ofe|u|", &rest2)) + else if (decoded_rest.startsWith("ofe|u|", &rest2)) { // Open for editing - override only in default mode if (curEvt == CommandLineEvent::Open) curEvt = CommandLineEvent::ForceOpen; nURIlen = rest2.indexOf("|"); } - else if (rest1.startsWith("nft|u|", &rest2)) + else if (decoded_rest.startsWith("nft|u|", &rest2)) { // New from template - override only in default mode if (curEvt == CommandLineEvent::Open) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits