Make detection of pasted URLs a little stricter
This commit is contained in:
parent
3c67e991c2
commit
e151b8e604
@ -1263,9 +1263,12 @@ class Window:
|
|||||||
return
|
return
|
||||||
if 'quote-urls-at-prompt' in opts.paste_actions and self.at_prompt:
|
if 'quote-urls-at-prompt' in opts.paste_actions and self.at_prompt:
|
||||||
prefixes = '|'.join(opts.url_prefixes)
|
prefixes = '|'.join(opts.url_prefixes)
|
||||||
if re.match(f'{prefixes}:', text) is not None:
|
m = re.match(f'({prefixes}):(.+)', text)
|
||||||
import shlex
|
if m is not None:
|
||||||
text = shlex.quote(text)
|
scheme, rest = m.group(1), m.group(2)
|
||||||
|
if rest.startswith('//') or scheme in ('mailto', 'irc'):
|
||||||
|
import shlex
|
||||||
|
text = shlex.quote(text)
|
||||||
btext = text.encode('utf-8')
|
btext = text.encode('utf-8')
|
||||||
if 'confirm' in opts.paste_actions:
|
if 'confirm' in opts.paste_actions:
|
||||||
msg = ''
|
msg = ''
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user