I posted an answer on a question about PHP/MySQL, specifically something vaguely related to SQL injection prevention. I know this is a touchy subject for many developers, so I tried to be objective and provided a viable alternative reasoning.
A question got voted down with a comment, so I edited it to decrease ambiguity and make it more clear in general. However, the user in question would refuse my arguments and accuse me of cargo cult programming and cluelessness on string escaping.
I further engaged with him on chat where he would just iterate on what he had already said in comments and not provide any useful reasoning behind his decision at all.
Since I am moderately certain, my answer was at least a decent one, I would have normally just shaked it off. However, the user has quite a lot of reputation, and such behaviour does not agree with my perception of a high-reputation user.
In case I am actually terribly wrong, I will apologize, but I don't think I am. I am relatively new to SE (even though my account is 2 years old), so I may have disregarded some policy or guideline or something else.
I ended up flagging one of his comments as rude and I am not sure if that was the right thing to do. What should I do in case of such problems?
Oh, and the answer in question: https://stackoverflow.com/a/10481116/267885
mysql_real_escape_string()
is for escaping string data; if you use it to escape numeric data, you need to wrap the value in quotes, otherwise the value remains vulnerable. This is a subtle but vital detail, and a common misconception. – Pekka May 7 '12 at 14:05