Home   Archive   Permalink



char ')' '(' in path - any way to stop join, reduce from evaluating parenthesis?

r ebol[]
    
dir: ')why/'
dir2: '(not'
;** Syntax Error: Missing ( at end-of-paren
    
; version 2:
;dir: '(why/'
;dir2: ')not'
;** Syntax Error: Invalid path --
    
;p: to-path join join '%/E/' dir dir2
p: to-path join '%/E/' reduce [ dir dir2 ]
    
    
    
red[]
    
;dir: ')why/'
;dir2: '(not'
; *** Syntax Error: missing #'(' at '/E/)why/(not'
    
; version 2:
dir: '(why/'
dir2: ')not'
;*** Syntax Error: invalid path! at 'why/)not'
;*** Where: do
    
path: to-path to-string reduce ['%/E/' dir dir2 ]
    
    
Is version 2 a path traversal security issue?
    
Thanks

posted by:   OneArb     18-Feb-2017/17:49:38-8:00



dir: ")why/"
dir2: "(not"
to-file rejoin ["/E/" dir dir2]
== %/E/%29why/%28not

posted by:   Nick     19-Feb-2017/21:18:15-8:00



Thanks,
    
to-file reduce ["/E/" dir dir2]
    
works as well

posted by:   OneArb     20-Feb-2017/11:44:38-8:00