Skip to content

[bug] Insecure redirect after publishing etc. #421

Closed
@fsbraun

Description

@fsbraun

djangocms-versioning implements a set of redirects after a version state change, e.g., redirect to the published version after publishing.

Depending on the site setup, those redirects might fail, e.g. when publishing a child page of an app hooked page. The app hook "swallows" all URLs below its own, and a redirect to the just published page fails with a 404.

djangocms-versioning should first check, if the redirect URLs are reversible and, if not, implement a fallback solution.

Affected IMHO are two instances:

As a fallback, I suggest using the preview URL if conf.ON_PUBLISH_REDIRECT in ("preview", "published"), otherwise the version list url.

To check if the URL is valid, resolve can be used:

try:
    resolve(url)
except Resolver404:
    url = fallback

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions