mirror of https://github.com/mpv-player/mpv
1a3e85ec33
Some youtube_dl extractors retrieve URLs which contain other URLs inside of them, for example Funimation, like this: https://example.com/video?parameter=https://example.net/something The url_is_safe function uses a pattern to match the protocol at the start of the URL. Before this commit, this pattern was not compliant with the URL spec (see the definition of "A URL-scheme string"): https://url.spec.whatwg.org/#url-writing Therefore it would match any characters, including "://", until the last occurence of "://" in the string. Thus the above URL would match https://example.com/video?parameter=https which is not in safe_protos so the video will not play. Now the protocol can only start with a letter and only contain alphanumerics, "." "+" or "-" as the spec says, so it will only match the first protocol in the URL ("https" in the above example.) Previously the URL also had to contain "//" after the ":". Data URLs do not contain "//": https://datatracker.ietf.org/doc/html/rfc2397 so now the pattern does not look for "//", only ":". |
||
---|---|---|
.. | ||
javascript | ||
lua | ||
audio.c | ||
client.c | ||
client.h | ||
command.c | ||
command.h | ||
configfiles.c | ||
core.h | ||
external_files.c | ||
external_files.h | ||
javascript.c | ||
loadfile.c | ||
lua.c | ||
main.c | ||
misc.c | ||
osd.c | ||
playloop.c | ||
screenshot.c | ||
screenshot.h | ||
scripting.c | ||
sub.c | ||
video.c |