Skip to content

Commit

Permalink
ShareInto: Strip common tracking parameters, by @gsantner, closes #1490
Browse files Browse the repository at this point in the history
  • Loading branch information
gsantner committed Jan 22, 2022
1 parent d4d8f41 commit 2b5d05c
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,8 @@ private static String formatLink(String text, String link) {
text = "";
}

link = link.replaceAll("(?m)(?<=&|\\?)(utm_|source|__mk_|ref|sprefix|crid|partner|promo).*?(&|$|\\s|\\))", "");

formattedLink = String.format("[%s](%s )",
text.trim().replace("[", "\\[").replace("]", "\\]"),
link.trim().replace("(", "\\(").replace(")", "\\)")
Expand Down

0 comments on commit 2b5d05c

Please sign in to comment.