php: reversing mysql_real_escape_string's effects on binary

后端 未结 4 1755
旧时难觅i
旧时难觅i 2021-01-25 04:25

I built a webpage where users can submit a PDF which is then inserted into a MySQL database in a mediumblob for retrieval later.

This all works fine, except when the PDF

4条回答
  •  心在旅途
    2021-01-25 04:42

    mysql_real_escape_string() puts backslashes to these characters.

    \x00, \n, \r, \, ', " and \x1a
    

    The thing is, that if your binary output has backslashes it it's binary data, it can be very hard to fix. That being said, there is no magical function to undo this function.

提交回复
热议问题