feat: use a proper path sanitization function for permitted paths

This commit is contained in:
David Bailey 2023-12-20 18:50:07 +01:00
parent b552562f31
commit eb87a78625
2 changed files with 26 additions and 6 deletions

View file

@ -64,7 +64,7 @@ class PostHandler extends MySQLAdapter {
function save_markdown_post($post_path, $post_data) {
$frontmatter_post = YamlFrontMatter::parse($post_data);
$post_path = chop($post_path, '/');
$post_path = $this->_sanitize_path($post_path);
$post_content = $frontmatter_post->body();
$post_metadata = $frontmatter_post->matter();