Skip to content

Commit d898efd

Browse files
authored
Merge pull request #301 from ThiesDS/hotfix/keyword_encoding
Bug fix keyword encoding when there are multiple keywords with '&'
2 parents f12a0a0 + a40de16 commit d898efd

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

R/zzz.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,10 @@ na.omit.list <- function(y) {
424424

425425
## Replace special characters in keywords like P&500 -> P%26500
426426
encode_keyword <- function(url) {
427+
url <- gsub("(?:\\G(?!^)|\\[\\s*)[^][\\s]*\\K\\&(?!])(?=[^][]*])", "%26", url, perl = TRUE)
428+
url <- gsub("(?:\\G(?!^)|\\[\\s*)[^][\\s]*\\K\\&(?!])(?=[^][]*])", "%26", url, perl = TRUE)
429+
url <- gsub("(?:\\G(?!^)|\\[\\s*)[^][\\s]*\\K\\&(?!])(?=[^][]*])", "%26", url, perl = TRUE)
430+
url <- gsub("(?:\\G(?!^)|\\[\\s*)[^][\\s]*\\K\\&(?!])(?=[^][]*])", "%26", url, perl = TRUE)
427431
gsub("(?:\\G(?!^)|\\[\\s*)[^][\\s]*\\K\\&(?!])(?=[^][]*])", "%26", url, perl = TRUE)
428432
}
429433

0 commit comments

Comments
 (0)