1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-09-30 19:22:11 +00:00

feat(reader): simplify blur query param checking

This commit is contained in:
Axel Verhaeghe 2025-09-30 08:51:34 +02:00
parent a8d539ec62
commit 955fb0824a

View file

@ -570,16 +570,10 @@ func stripImageQueryParams(entryContent string) string {
// Only strip query parameters if this is a blurry placeholder image // Only strip query parameters if this is a blurry placeholder image
if parsedURL.RawQuery != "" { if parsedURL.RawQuery != "" {
queryParams, err := url.ParseQuery(parsedURL.RawQuery)
if err != nil {
return
}
// Check if there's a blur parameter with a non-zero value // Check if there's a blur parameter with a non-zero value
blurValues, hasBlur := queryParams["blur"] blurValue := parsedURL.Query().Get("blur")
if hasBlur && len(blurValues) > 0 { if blurValue != "" {
blurValue, err := strconv.Atoi(blurValues[0]) if blurInt, err := strconv.Atoi(blurValue); err == nil && blurInt > 0 {
if err == nil && blurValue > 0 {
parsedURL.RawQuery = "" parsedURL.RawQuery = ""
img.SetAttr("src", parsedURL.String()) img.SetAttr("src", parsedURL.String())
changed = true changed = true