yourcelf / btb

Codebase that powers Between the Bars, a blogging platform for people in prison. Splitting/parsing/publishing PDFs, managing paper correspondence.
http://betweenthebars.org
GNU Affero General Public License v3.0
13 stars 6 forks source link

500 Error When Using Comment Removal Process #35

Closed skilfullycurled closed 7 years ago

skilfullycurled commented 7 years ago

Blogger requested that two comments be removed per this letter:

Removed comments using standard removal method:

Steps to recreate:

  1. Created reason in admin backend
  2. Reason: "Request From Blogger"
  3. Web message: blank
  4. Comment author message: blank (no email address for comment author)
  5. Post author message: "Per your request in a letter dated 6/12/17, we have removed the following comment."
  6. Preview rendered letter (Throws 500)
  7. Remove comment and send notification (Throws 500)
yourcelf commented 7 years ago

Fixed in e58e3741bbf14f9d85818890a0c80cc6aa33cc0e. The script that escapes input for Latex rendering was not properly converting windows-style CRLF line endings (e.g. "\r\n") into latex-style newlines (e.g. "\\"). It only replaced the LF part ("\n"), leaving the string "\r\\" in the latex document, which caused an error. It appears that bare CRLF endings in the comment body triggered this. Windows-style line endings are now properly escaped.