From a40de16dfa444e2c1aaf125107acff270f79fdbb Mon Sep 17 00:00:00 2001 From: Sven Thies Date: Sun, 28 Apr 2019 13:27:16 +0200 Subject: [PATCH] Bug fix keyword encoding when there are multiple keywords which contain '&' character. --- R/zzz.R | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/R/zzz.R b/R/zzz.R index ee9c08c..6d91c80 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -417,6 +417,10 @@ na.omit.list <- function(y) { ## Replace special characters in keywords like P&500 -> P%26500 encode_keyword <- function(url) { + url <- gsub("(?:\\G(?!^)|\\[\\s*)[^][\\s]*\\K\\&(?!])(?=[^][]*])", "%26", url, perl = TRUE) + url <- gsub("(?:\\G(?!^)|\\[\\s*)[^][\\s]*\\K\\&(?!])(?=[^][]*])", "%26", url, perl = TRUE) + url <- gsub("(?:\\G(?!^)|\\[\\s*)[^][\\s]*\\K\\&(?!])(?=[^][]*])", "%26", url, perl = TRUE) + url <- gsub("(?:\\G(?!^)|\\[\\s*)[^][\\s]*\\K\\&(?!])(?=[^][]*])", "%26", url, perl = TRUE) gsub("(?:\\G(?!^)|\\[\\s*)[^][\\s]*\\K\\&(?!])(?=[^][]*])", "%26", url, perl = TRUE) }