|
|
|
|
|
|
|
|
|
|
|
|
|
|
sanitize_text_input <- function(x) { |
|
|
sanitize_text_input <- function(x) { |
|
|
if (is.null(x) || !nchar(x)) return(x) |
|
|
if (is.null(x) || !nchar(x)) return(x) |
|
|
rx_unicode <- "\\u[0-9a-f]{4,8}" |
|
|
|
|
|
|
|
|
rx_unicode <- "\\\\u[0-9a-f]{4,8}" |
|
|
rx_hex <- "\\\\x[0-9a-f]{2}|\\\\x\\{[0-9a-f]{1,6}\\}" |
|
|
rx_hex <- "\\\\x[0-9a-f]{2}|\\\\x\\{[0-9a-f]{1,6}\\}" |
|
|
rx_octal <- "\\\\[0][0-7]{1,3}" |
|
|
rx_octal <- "\\\\[0][0-7]{1,3}" |
|
|
rx_escape <- paste(rx_unicode, rx_hex, rx_octal, sep = "|") |
|
|
rx_escape <- paste(rx_unicode, rx_hex, rx_octal, sep = "|") |