php: reversing mysql_real_escape_string's effects on binary

后端 未结 4 1695
旧时难觅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:41

    Sure, should be fixable. You just need to figure out exactly what mysql_real_escape_string does. I believe you just need to remove any slashes that immediately precede a CR, LF, TAB, single-quote, double-quote, NUL, or another slash. Should be a one-line regexp fix.

提交回复
热议问题