mirror of
https://github.com/miniflux/v2.git
synced 2025-06-27 16:36:00 +00:00
Add missing regex anchor detected by CodeQL
This commit is contained in:
parent
b2ce98da87
commit
c493f8921e
4 changed files with 5 additions and 5 deletions
|
@ -26,7 +26,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
youtubeRegex = regexp.MustCompile(`youtube\.com/watch\?v=(.*)`)
|
youtubeRegex = regexp.MustCompile(`youtube\.com/watch\?v=(.*)$`)
|
||||||
odyseeRegex = regexp.MustCompile(`^https://odysee\.com`)
|
odyseeRegex = regexp.MustCompile(`^https://odysee\.com`)
|
||||||
iso8601Regex = regexp.MustCompile(`^P((?P<year>\d+)Y)?((?P<month>\d+)M)?((?P<week>\d+)W)?((?P<day>\d+)D)?(T((?P<hour>\d+)H)?((?P<minute>\d+)M)?((?P<second>\d+)S)?)?$`)
|
iso8601Regex = regexp.MustCompile(`^P((?P<year>\d+)Y)?((?P<month>\d+)M)?((?P<week>\d+)W)?((?P<day>\d+)D)?(T((?P<hour>\d+)H)?((?P<minute>\d+)M)?((?P<second>\d+)S)?)?$`)
|
||||||
customReplaceRuleRegex = regexp.MustCompile(`rewrite\("(.*)"\|"(.*)"\)`)
|
customReplaceRuleRegex = regexp.MustCompile(`rewrite\("(.*)"\|"(.*)"\)`)
|
||||||
|
|
|
@ -20,7 +20,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
youtubeRegex = regexp.MustCompile(`youtube\.com/watch\?v=(.*)`)
|
youtubeRegex = regexp.MustCompile(`youtube\.com/watch\?v=(.*)$`)
|
||||||
youtubeIdRegex = regexp.MustCompile(`youtube_id"?\s*[:=]\s*"([a-zA-Z0-9_-]{11})"`)
|
youtubeIdRegex = regexp.MustCompile(`youtube_id"?\s*[:=]\s*"([a-zA-Z0-9_-]{11})"`)
|
||||||
invidioRegex = regexp.MustCompile(`https?://(.*)/watch\?v=(.*)`)
|
invidioRegex = regexp.MustCompile(`https?://(.*)/watch\?v=(.*)`)
|
||||||
imgRegex = regexp.MustCompile(`<img [^>]+>`)
|
imgRegex = regexp.MustCompile(`<img [^>]+>`)
|
||||||
|
|
|
@ -19,7 +19,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
youtubeEmbedRegex = regexp.MustCompile(`//www\.youtube\.com/embed/(.*)`)
|
youtubeEmbedRegex = regexp.MustCompile(`//www\.youtube\.com/embed/(.*)$`)
|
||||||
tagAllowList = map[string][]string{
|
tagAllowList = map[string][]string{
|
||||||
"a": {"href", "title", "id"},
|
"a": {"href", "title", "id"},
|
||||||
"abbr": {"title"},
|
"abbr": {"title"},
|
||||||
|
|
|
@ -23,8 +23,8 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
youtubeChannelRegex = regexp.MustCompile(`youtube\.com/channel/(.*)`)
|
youtubeChannelRegex = regexp.MustCompile(`youtube\.com/channel/(.*)$`)
|
||||||
youtubeVideoRegex = regexp.MustCompile(`youtube\.com/watch\?v=(.*)`)
|
youtubeVideoRegex = regexp.MustCompile(`youtube\.com/watch\?v=(.*)$`)
|
||||||
)
|
)
|
||||||
|
|
||||||
type SubscriptionFinder struct {
|
type SubscriptionFinder struct {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue