Fixing duplicate parameter start.

If a ?ref=xyz parameter was part of the URL, a second one was added during sharing, e.g. ?ref=xyz?ref=abc. This pull request fixes this behaviour by removing all existing parameters before sharing.