MINOR Clean up code of MSSQLDatabase::addslashes()

This commit is contained in:
Sean Harvey 2010-12-15 23:18:27 +00:00
parent bff9718dd6
commit c104222019

View File

@ -1246,16 +1246,15 @@ class MSSQLDatabase extends SS_Database {
return $text; return $text;
} }
/* /**
* This will return text which has been escaped in a database-friendly manner * Escapes a value with specific escape characters specific to the MSSQL.
* Using PHP's addslashes method won't work in MSSQL * @param string $value String to escape
* @return string Escaped string
*/ */
function addslashes($value){ function addslashes($value) {
// $value=stripslashes($value); $value = str_replace("'", "''", $value);
$value=str_replace("'","''",$value); $value = str_replace("\0", "[NULL]", $value);
$value=str_replace("\0","[NULL]",$value); return $value;
return $value;
} }
/** /**