fix: social images are validated on the API, MCP, batch and import paths (WR-16)
Only the admin seoimage field refused values that are not a path or an http(s) URL; SetURLSEO, SaveRule and SaveSettings stored javascript:, data: or protocol-relative values, which /resolve then served as og:image. All three now refuse them with image.url_invalid.
This commit is contained in:
@@ -145,6 +145,9 @@ func (s *Service) SetURLSEO(ctx context.Context, tx *gorm.DB, in URLSEOWrite) (U
|
||||
case column == "canonical" && v != "" && !ValidURLRef(v):
|
||||
problems[column] = append(problems[column], models.Problem{Key: "golem15.seo::lang.api.canonical_invalid"})
|
||||
continue
|
||||
case column == "og_image" && !ValidImageURL(v):
|
||||
problems[column] = append(problems[column], models.Problem{Key: errImageURL})
|
||||
continue
|
||||
}
|
||||
values[column] = v
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user