728842d6e88d44cda6e585914e23108f6015d09f — Francis Dinh 8 months ago 1ea5ac3 0.2.4
Normalize linefeeds when submitting via web form

The previous attempt at fixing it only does it for the REST API. This
applies the change for submission via web as well.

Fixes #10
1 files changed, 1 insertions(+), 0 deletions(-)

M pastesrht/blueprints/public.py
M pastesrht/blueprints/public.py => pastesrht/blueprints/public.py +1 -0
@@ 29,6 29,7 @@ def index():
 def new_paste_POST():
     valid = Validation(request)
     contents = valid.require("contents", friendly_name="File contents")
+    contents = contents.replace("\r\n", "\n").replace("\r", "\n")
     filename = valid.optional("filename")
     commit = valid.require("commit")
     filename = filename.strip() if filename else filename