Fixes the Unicode strings issue on SQLServer and SQLAzure #766

Closed
wants to merge 3 commits into from

5 participants

@sseshachala

Fixes the Unicode strings issue as mentioned in
http://support.microsoft.com/kb/239530

@chdemko chdemko commented on the diff Jan 20, 2012
libraries/joomla/database/database/sqlsrv.php
@@ -671,6 +671,20 @@ public function query()
return $this->cursor;
}
/**
@chdemko
chdemko added a note Jan 20, 2012

code style: add blank line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@chdemko chdemko commented on the diff Jan 20, 2012
libraries/joomla/database/database/sqlsrv.php
@@ -671,6 +671,20 @@ public function query()
return $this->cursor;
}
/**
+ * Method to quote and optionally escape a string to database requirements for insertion into the database.
@chdemko
chdemko added a note Jan 20, 2012

Code style: add space before each *

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@chdemko chdemko commented on an outdated diff Jan 20, 2012
libraries/joomla/database/database/sqlsrv.php
@@ -671,6 +671,20 @@ public function query()
return $this->cursor;
}
/**
+ * Method to quote and optionally escape a string to database requirements for insertion into the database.
+ *
+ * @param string $text The string to quote.
+ * @param boolean $escape True (default) to escape the string, false to leave it unchanged.
+ *
+ * @return string The quoted input string.
+ *
+ * @since 11.1
+ */
+ public function quote($text, $escape = true)
+ {
+ return 'N' . '\'' . ($escape ? $this->escape($text) : $text) . '\'';
+ }
+ /**
* This function replaces a string identifier <var>$prefix</var> with the string held is the
@chdemko
chdemko added a note Jan 20, 2012

code style: add blank line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@chdemko chdemko commented on an outdated diff Jan 20, 2012
libraries/joomla/database/database/sqlsrv.php
@@ -671,6 +671,20 @@ public function query()
return $this->cursor;
}
/**
+ * Method to quote and optionally escape a string to database requirements for insertion into the database.
+ *
+ * @param string $text The string to quote.
+ * @param boolean $escape True (default) to escape the string, false to leave it unchanged.
+ *
+ * @return string The quoted input string.
+ *
+ * @since 11.1
+ */
+ public function quote($text, $escape = true)
+ {
+ return 'N' . '\'' . ($escape ? $this->escape($text) : $text) . '\'';
@chdemko
chdemko added a note Jan 20, 2012

You could use 'N\'' . ($escape ? $this->escape($text) : $text) . '\'';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@joomla-jenkins

Unit testing complete. There were 0 failures and 0 errors from 1941 tests and 11081 assertions.
Checkstyle analysis reported 165 warnings and 2 errors.

@joomla-jenkins

Build triggered by changes to the head.

Unit testing complete. There were 0 failures and 0 errors from 1941 tests and 11081 assertions.
Checkstyle analysis reported 165 warnings and 1 errors.

@elkuku elkuku commented on the diff Jan 21, 2012
libraries/joomla/database/database/sqlsrv.php
@@ -671,6 +671,20 @@ public function query()
return $this->cursor;
}
/**
+ * Method to quote and optionally escape a string to database requirements for insertion into the database.
+ *
+ * @param string $text The string to quote.
+ * @param boolean $escape True (default) to escape the string, false to leave it unchanged.
+ *
+ * @return string The quoted input string.
+ *
+ * @since 11.1
+ */
+ public function quote($text, $escape = true)
+ {
+ return 'N\'' . ($escape ? $this->escape($text) : $text) . '\'';
+ }
@elkuku
Joomla! member
elkuku added a note Jan 21, 2012

Whitespace found at end of line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@chdemko

@sseshachala The pull request cannot be merged.

@LouisLandry

This has been sitting for over 2 months without update and is not currently mergeable. I'm going to close it for now. If you want to continue the discussion please rebase the branch against current master and re-open the pull request. Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment