Compare commits

...
2 Commits
Author SHA1 Message Date
kitoy b11947bb7e Merge branch 'master' of ssh://kitoy.me:56565/kitoy/pywallter 2026-09-03 03:40:07 +02:00
kitoy 787c23ee9b Make title_id less buggy
When the title have ponctuation or finish by space it's cause bug when
you share the link ! We keep characteres alphanumeric  and replace space
by '-' character for index the article
2026-09-03 03:38:43 +02:00
+4 -1
View File
@@ -7,6 +7,7 @@ import sqlite3
from markdown import markdown
from tools.filesutils import getFileSizeKo
import string
import re
from shutil import copy
from tools.utils import login_required
@@ -35,7 +36,9 @@ def new_article():
user = '%s' % escape(session['username'])
if request.method == 'POST':
title_id = escape(request.form['title'].rstrip())
tmp = re.sub(r'[^a-zA-Z0-9 ]', '', request.form['title'].rstrip())
title_id = tmp.replace(' ', '-')
print("---------title_id : " + title_id)
title = request.form['title'].rstrip()
subtitle = request.form['subtitle']
category = request.form['category']