diff --git a/freepost/__init__.py b/freepost/__init__.py index 01b2c0c..d30ca8e 100755 --- a/freepost/__init__.py +++ b/freepost/__init__.py @@ -183,8 +183,8 @@ def login_check (): Check login form. """ - username = request.forms.get ('username') - password = request.forms.get ('password') + username = request.forms.getunicode ('username') + password = request.forms.getunicode ('password') remember = 'remember' in request.forms if not username or not password: @@ -226,8 +226,8 @@ def register_new_account (): Check form for creating new account. """ - username = request.forms.get ('username') - password = request.forms.get ('password') + username = request.forms.getunicode ('username') + password = request.forms.getunicode ('password') # Normalize username username = username.strip () @@ -289,8 +289,8 @@ def password_reset_send_code (): code via email. """ - username = request.forms.get ('username') - email = request.forms.get ('email') + username = request.forms.getunicode ('username') + email = request.forms.getunicode ('email') if not username or not email: redirect (application.get_url ('change_password')) @@ -348,10 +348,10 @@ def validate_new_password (): is OK change the user password. """ - username = request.forms.get ('username') - email = request.forms.get ('email') - password = request.forms.get ('password') - secret_token = request.forms.get ('token') + username = request.forms.getunicode ('username') + email = request.forms.getunicode ('email') + password = request.forms.getunicode ('password') + secret_token = request.forms.getunicode ('token') # We must have all fields if not username or not email or not password or not secret_token: @@ -404,8 +404,8 @@ def update_user_settings (): user = session.user () - about = request.forms.get ('about') - email = request.forms.get ('email') + about = request.forms.getunicode ('about') + email = request.forms.getunicode ('email') if about is None or email is None: redirect (application.get_url ('user_settings')) @@ -509,7 +509,7 @@ def new_comment (hash_id): user = session.user () # The comment text - comment = request.forms.get ('new_comment').strip () + comment = request.forms.getunicode ('new_comment').strip () # Empty comment if len (comment) == 0: @@ -548,10 +548,10 @@ def edit_post_check (hash_id): redirect (application.get_url ('homepage')) # MUST have a title. If empty, use original title - title = request.forms.get ('title').strip () + title = request.forms.getunicode ('title').strip () if len (title) == 0: title = post['title'] - link = request.forms.get ('link').strip () if 'link' in request.forms else '' - text = request.forms.get ('text').strip () if 'text' in request.forms else '' + link = request.forms.getunicode ('link').strip () if 'link' in request.forms else '' + text = request.forms.getunicode ('text').strip () if 'text' in request.forms else '' # If there is a URL, make sure it has a "scheme" if len (link) > 0 and urlparse (link).scheme == '': @@ -584,7 +584,7 @@ def edit_comment_check (hash_id): if comment['userId'] != user['id']: redirect (application.get_url ('homepage')) - text = request.forms.get ('text').strip () if 'text' in request.forms else '' + text = request.forms.getunicode ('text').strip () if 'text' in request.forms else '' # Only update if the text is not empty if len (text) > 0: @@ -609,30 +609,30 @@ def submit_check (): """ # Somebody sent a