english/libraries/joomla/database/database/sqlsrv.php
/**
	 * Method to escape a string for usage in an SQL statement.
	 *
	 * The escaping for MSSQL isn't handled in the driver though that would be nice.  Because of this we need
	 * to handle the escaping ourselves.
	 *
	 * @param   string   $text   The string to be escaped.
	 * @param   boolean  $extra  Optional parameter to provide extra escaping.
	 *
	 * @return  string  The escaped string.
	 *
	 * @since   11.1
	 */
Method to escape a string for usage in an SQL statement.
The escaping for MSSQL isn't handled in the driver though that would be nice.  Because of this we need
to handle the escaping ourselves.

@param   string   $text   The string to be escaped.
@param   boolean  $extra  Optional parameter to provide extra escaping.

@return  string  The escaped string.


Method to escape a string for usage in an SQL statement . The escaping for MSSQL isn ' t handled in the driver though that would be nice . Because of this we need to handle the escaping ourselves . @param string $text The string to be escaped . @param boolean $extra Optional parameter to provide extra escaping . @return string The escaped string .
public function escape($text, $extra = false)
	{
		$result = addslashes($text);
		$result = str_replace("\'", "''", $result);
		$result = str_replace('\"', '"', $result);
		if ($extra) {
			$result = str_replace('_', '[_]', $result);
		}
		return $result;
	}
public function escape ( $ text , $ extra = false ) { $ result = addslashes ( $ text ) ; $ result = str_replace ( " \' " , " '' " , $ result ) ; $ result = str_replace ( '\"' , '"' , $ result ) ; if ( $ extra ) { $ result = str_replace ( '_' , '[_]' , $ result ) ; } return $ result ; }
Method to escape a string for usage in an SQL statement.
Method to escape a string for usage in an SQL statement .
// TODO: MSSQL Compatible escaping //$result = str_replace("\\", "''", $result); // We need the below str_replace since the search in sql server doesnt recognize _ character.