]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - extlib/DB/mssql.php
DB updated to 1.8.2
[quix0rs-gnu-social.git] / extlib / DB / mssql.php
index 511a2b686a1f4b66dceed35cef1b255ef2ce662d..e25caf144eba6e68e95944ba4af6a1a3c6ebbfc8 100644 (file)
@@ -6,7 +6,7 @@
  * The PEAR DB driver for PHP's mssql extension
  * for interacting with Microsoft SQL Server databases
  *
- * PHP versions 4 and 5
+ * PHP version 5
  *
  * LICENSE: This source file is subject to version 3.0 of the PHP license
  * that is available through the world-wide-web at the following URI:
@@ -20,7 +20,7 @@
  * @author     Daniel Convissor <danielc@php.net>
  * @copyright  1997-2007 The PHP Group
  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
- * @version    CVS: $Id: mssql.php,v 1.92 2007/09/21 13:40:41 aharvey Exp $
+ * @version    CVS: $Id$
  * @link       http://pear.php.net/package/DB
  */
 
@@ -49,7 +49,7 @@ require_once 'DB/common.php';
  * @author     Daniel Convissor <danielc@php.net>
  * @copyright  1997-2007 The PHP Group
  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
- * @version    Release: 1.7.14RC1
+ * @version    Release: 1.8.2
  * @link       http://pear.php.net/package/DB
  */
 class DB_mssql extends DB_common
@@ -623,6 +623,27 @@ class DB_mssql extends DB_common
         return $this->query('DROP TABLE ' . $this->getSequenceName($seq_name));
     }
 
+    // }}}
+    // {{{ escapeSimple()
+
+    /**
+     * Escapes a string in a manner suitable for SQL Server.
+     *
+     * @param string $str  the string to be escaped
+     * @return string  the escaped string
+     *
+     * @see DB_common::quoteSmart()
+     * @since Method available since Release 1.6.0
+     */
+    function escapeSimple($str)
+    {
+        return str_replace(
+            array("'", "\\\r\n", "\\\n"),
+            array("''", "\\\\\r\n\r\n", "\\\\\n\n"),
+            $str
+        );
+    }
+
     // }}}
     // {{{ quoteIdentifier()