diff --git a/RELEASE.md b/RELEASE.md new file mode 100644 index 00000000..88e2308d --- /dev/null +++ b/RELEASE.md @@ -0,0 +1,3 @@ +Release type: patch + +Sanitize slashes in WordPress import titles to prevent crash. Fixes #3561 diff --git a/pelican/tools/pelican_import.py b/pelican/tools/pelican_import.py index 1c03f9c9..2c72107f 100755 --- a/pelican/tools/pelican_import.py +++ b/pelican/tools/pelican_import.py @@ -968,6 +968,9 @@ def fields2pelican( if is_pandoc_needed(in_markup) and not pandoc_version: posts_require_pandoc.append(filename) + #Replace "/" with "-" in filename + filename = filename.replace("/", "-") + slug = (not disable_slugs and filename) or None assert slug is None or filename == os.path.basename(filename), ( f"filename is not a basename: {filename}"