瀏覽代碼

Fix ry v0.6.1 audit findings

pull/27/head
Maximilian Scholz 2 月之前
父節點
當前提交
0fa1ecd16d
共有 4 個文件被更改,包括 6 次插入 和 6 次删除
  1. +3
    -3
      R/addins.R
  2. +1
    -1
      R/gadget_server.R
  3. +1
    -1
      R/regex.R
  4. +1
    -1
      R/shiny_modified_inputs.R

+ 3
- 3
R/addins.R 查看文件

@@ -16,7 +16,7 @@ regexplain_addin <- function() {
# Get context text
ctx_text <- context$selection[[1]]$text

max_lines <- getOption("rexeplain.addin.max_lines", 100)
max_lines <- getOption("regexplain.addin.max_lines", 100)

# If it is one line and evaluates to something, use that
# Otherwise treat as text
@@ -55,7 +55,7 @@ regexplain_addin <- function() {
}
)

regexplain_gadget(if (length(obj) && obj != "") obj)
regexplain_gadget(if (length(obj) && all(nzchar(obj))) obj)
}

#' @describeIn regexplain_gadget Opens file chooser to pick file, reads lines,
@@ -65,7 +65,7 @@ regexplain_addin <- function() {
regexplain_file <- function(pattern = NULL, start_page = "RegEx") {
fname <- file.choose()
x <- readLines(fname)
max_lines <- getOption("rexeplain.addin.max_lines", 100)
max_lines <- getOption("regexplain.addin.max_lines", 100)
if (length(x) > max_lines) {
message("There were ", format(length(x), big.mark = ","), " lines in ",
fname, "\nUsing only first ", max_lines, ".\n",

+ 1
- 1
R/gadget_server.R 查看文件

@@ -300,7 +300,7 @@ regexplain_gadget_server <- function(update_available = NULL) {
}
do.call(
eval(parse(text = "stringr::regex")),
list(pattern = pattern, ignore_case, ignore_case, literal = literal)
list(pattern = pattern, ignore_case = ignore_case, literal = literal)
)
}


+ 1
- 1
R/regex.R 查看文件

@@ -203,7 +203,7 @@ wrap_regex <- function(pattern, escape = TRUE, exact = TRUE) {
} else if (pattern_chars[i] == ")") {
closes_capture_group <- paren_stack[1]
paren_stack <- paren_stack[-1] # pop
if (closes_capture_group) {
if (isTRUE(closes_capture_group)) {
out <- c(out, ")</span>")
} else {
out <- c(out, ")")

+ 1
- 1
R/shiny_modified_inputs.R 查看文件

@@ -49,7 +49,7 @@ textAreaInputAlt <- function(
shiny::div(
class = "form-group shiny-input-container",
tags$label(label, `for` = inputId),
style = if (!parent_style %in% c(" ", "", " ")) parent_style,
style = if (length(parent_style) && !all(parent_style %in% c(" ", "", " "))) parent_style,
shiny::tags$textarea(
id = inputId,
class = "form-control",

Loading…
取消
儲存