From c0b8e02eeed3960032f48adab5682e7bc9ed4833 Mon Sep 17 00:00:00 2001 From: MrStonedOne Date: Fri, 8 Aug 2014 00:15:33 -0700 Subject: [PATCH] SQL injection fix. Google sanitizing sql input. almost every single article explains why you should never attempt to roll your own function to do this. --- code/__HELPERS/text.dm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/code/__HELPERS/text.dm b/code/__HELPERS/text.dm index af77addeab0..adee6bb7c89 100644 --- a/code/__HELPERS/text.dm +++ b/code/__HELPERS/text.dm @@ -15,9 +15,7 @@ // Run all strings to be used in an SQL query through this proc first to properly escape out injection attempts. /proc/sanitizeSQL(var/t as text) - var/sanitized_text = replacetext(t, "'", "\\'") - sanitized_text = replacetext(sanitized_text, "\"", "\\\"") - return sanitized_text + return dbcon.Quote(t); /* * Text sanitization