atmoner / php-pastebin-v3

Php pastebin tool
110 stars 56 forks source link

missing backslashes #58

Open byt3farm opened 7 years ago

byt3farm commented 7 years ago

when pasting code (for example php) with backslashes (in strings) they will just disappear; example: if you paste echo "\n new line" ; it will be rendered to echo "n new line";

this issue makes this pretty tool almost useless at all for source code...

see also https://www.bytefarm.ch/tools/php-pastebin-v3/mjAnkf3U

atmoner commented 7 years ago

I would correct when I was home

But the problem can only come from two places:

byt3farm commented 7 years ago

Yes, it is second https://github.com/atmoner/php-pastebin-v3/blob/master/libs/default.class.php#L337 without stripslashes() it works perfect.

I fixed it and tried to push it (as a new branch) but I am either not allowed or too stupid to do it (sorry I am still new to github)

BTW (offtopic) (https://github.com/atmoner/php-pastebin-v3/blob/master/libs/default.class.php#L148): mysql_escape_string() was deprecated in PHP 4.3.0 (!). If you use that ezSQL_mysql you wouldn't you consider using their escape function $db->escape() anymay? AND The whole mysql stuff should be substituted by mysqli (or PDO) instead anyway - it was deprecated in PHP7 at all.