function is_path_containing_userinput(parameter, target, is_windows, is_lcs_search)
{
    var verdict = false
    if (is_windows) {
        target = target.replaceAll('/', '\\').replaceAll('\\\\', '\\')
    }
    else{
        target = target.replaceAll('//', '/')
    }

    Object.keys(parameter).some(function (key) {
        var values = parameter[key]
        Object.values(values).some(function(value){
            // Only handle string type
            if (typeof value != 'string') {
                return
            }
            if (is_windows) {
                value = value.replaceAll('/', '\\').replaceAll('\\\\', '\\')
            }
            else {
                value = value.replaceAll('//', '/')
            }
            var values
            if (is_lcs_search) {
                values = lcs_search(value, target)
            }
            else {
               // Below java, passing in /usr/ will become /usr, so one less character is matched
                if ( value.charAt(value.length - 1) == "/" || 
                    value.charAt(value.length - 1) == "\\" ) {
                    value = value.substr(0, value.length - 1)
                }
                values = [value]
            }
            for(var i = 0, len = values.length; i < len; i++) {
                // Only handle non-array and hash situations
                if (param_has_traversal(values[i]) && target.indexOf(values[i]) != -1) {
                    verdict = true
                    return true
                }
            }
        })
        if (verdict){
            return true
        }
    })
    return verdict
}
// Check if user input is included-suitable for directory
Check if user input is included-suitable for directory
Check if user input is included - suitable for directory
function is_path_containing_userinput(parameter, target, is_windows, is_lcs_search)
{
    var verdict = false
    if (is_windows) {
        target = target.replaceAll('/', '\\').replaceAll('\\\\', '\\')
    }
    else{
        target = target.replaceAll('//', '/')
    }
    Object.keys(parameter).some(function (key) {
        var values = parameter[key]
        Object.values(values).some(function(value){
            if (typeof value != 'string') {
                return
            }
            if (is_windows) {
                value = value.replaceAll('/', '\\').replaceAll('\\\\', '\\')
            }
            else {
                value = value.replaceAll('//', '/')
            }
            var values
            if (is_lcs_search) {
                values = lcs_search(value, target)
            }
            else {
                if ( value.charAt(value.length - 1) == "/" || 
                    value.charAt(value.length - 1) == "\\" ) {
                    value = value.substr(0, value.length - 1)
                }
                values = [value]
            }
            for(var i = 0, len = values.length; i < len; i++) {
                if (param_has_traversal(values[i]) && target.indexOf(values[i]) != -1) {
                    verdict = true
                    return true
                }
            }
        })
        if (verdict){
            return true
        }
    })
    return verdict
}
function is_path_containing_userinput ( parameter , target , is_windows , is_lcs_search ) { var verdict = false if ( is_windows ) { target = target . replaceAll ( '/' , '\\' ) . replaceAll ( '\\\\' , '\\' ) } else { target = target . replaceAll ( '//' , '/' ) } Object . keys ( parameter ) . some ( function ( key ) { var values = parameter [ key ] Object . values ( values ) . some ( function ( value ) { if ( typeof value != 'string' ) { return } if ( is_windows ) { value = value . replaceAll ( '/' , '\\' ) . replaceAll ( '\\\\' , '\\' ) } else { value = value . replaceAll ( '//' , '/' ) } var values if ( is_lcs_search ) { values = lcs_search ( value , target ) } else { if ( value . charAt ( value . length - 1 ) == "/" || value . charAt ( value . length - 1 ) == "\\" ) { value = value . substr ( 0 , value . length - 1 ) } values = [ value ] } for ( var i = 0 , len = values . length ; i < len ; i ++ ) { if ( param_has_traversal ( values [ i ] ) && target . indexOf ( values [ i ] ) != - 1 ) { verdict = true return true } } } ) if ( verdict ) { return true } } ) return verdict }
Check if user input is included-suitable for directory
Check if user input is included - suitable for directory
// Only handle string type // Below java, passing in /usr/ will become /usr, so one less character is matched // Only handle non-array and hash situations