mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-11 04:53:45 -05:00
Reject invalid URLs from GBrowse providers
This commit is contained in:
@@ -7457,19 +7457,14 @@ function! fugitive#BrowseCommand(line1, count, range, bang, mods, arg, ...) abor
|
|||||||
let opts.path = s:sub(path, '/\=$', '/')
|
let opts.path = s:sub(path, '/\=$', '/')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let url = ''
|
for l:.Handler in get(g:, 'fugitive_browse_handlers', [])
|
||||||
for Handler in get(g:, 'fugitive_browse_handlers', [])
|
let l:.url = call(Handler, [copy(opts)])
|
||||||
let url = call(Handler, [copy(opts)])
|
if type(url) == type('') && url =~# '://'
|
||||||
if !empty(url)
|
return s:BrowserOpen(url, a:mods, a:bang)
|
||||||
break
|
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
if empty(url)
|
throw "fugitive: no GBrowse handler installed for '".raw."'"
|
||||||
throw "fugitive: no GBrowse handler installed for '".raw."'"
|
|
||||||
endif
|
|
||||||
|
|
||||||
return s:BrowserOpen(url, a:mods, a:bang)
|
|
||||||
catch /^fugitive:/
|
catch /^fugitive:/
|
||||||
return 'echoerr ' . string(v:exception)
|
return 'echoerr ' . string(v:exception)
|
||||||
endtry
|
endtry
|
||||||
|
|||||||
Reference in New Issue
Block a user