Do you think I could just leave this part blank and it'd be okay? We're just going to replace the whole thing with a header image anyway, right?
You are not logged in.
Pages: 1
Topic closed
whenever you do a ' in rep it corrects to \' for some reason
Offline
It's just PHP screwing up escape characters. Nothing to see here... Move on...
Offline
Please. You never escape on HTML with \. You use ' for ' and " for ".
Offline
Please. You never escape on HTML with \. You use ' for ' and " for ".
No but you escape MySQL with \ which is what's going on here.
"Sometimes failing a leap of faith is better than inching forward"
- ShinsukeIto
Offline
HG wrote:Please. You never escape on HTML with \. You use ' for ' and " for ".
No but you escape MySQL with \ which is what's going on here.
Then escape the ' using the Unicode value, u0027. Then u0022 for ". I don't know how to escape Unicode on MySQL, but I guess you could use \x22 or \0x22. It's how it works on the Lua scripting language.
Offline
Different55 wrote:HG wrote:Please. You never escape on HTML with \. You use ' for ' and " for ".
No but you escape MySQL with \ which is what's going on here.
Then escape the ' using the Unicode value, u0027. Then u0022 for ". I don't know how to escape Unicode on MySQL, but I guess you could use \x22 or \0x22. It's how it works on the Lua scripting language.
It's clear that you don't know how PHP+MySQL works... You should probably just stop talking.
If only there was a technique that allowed you to prepare SQL queries in such a way that you can issue a query without any need to escape the inputs...
Offline
Fixed, locked. The rep system escaped things with PHP's addslashes() function, and then fed it through the mysqli_real_escape_string(). So first addslashes escaped quotes with \s, then mysql's escape came along and re-escaped those, and also escaped the backslashes.
"Sometimes failing a leap of faith is better than inching forward"
- ShinsukeIto
Offline
Pages: 1
Topic closed
[ Started around 1738446280.7328 - Generated in 0.040 seconds, 12 queries executed - Memory usage: 1.43 MiB (Peak: 1.53 MiB) ]