cvs: php4 /pear/DB common.php
| From: | Thomas V.V.Cox | Date: | Thu, 23 Aug 2001 02:36:55 +0000 |
| Subject: | cvs: php4 /pear/DB common.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-624@lists.php.net to get a copy of this message | ||
cox Wed Aug 22 22:36:55 2001 EDT
Modified files:
/php4/pear/DB common.php
Log:
make quoteString() backwards compatible with the original version (quote()
is still the prefered quote method)
Index: php4/pear/DB/common.php
diff -u php4/pear/DB/common.php:1.60 php4/pear/DB/common.php:1.61
--- php4/pear/DB/common.php:1.60 Mon Aug 20 22:44:21 2001
+++ php4/pear/DB/common.php Wed Aug 22 22:36:55 2001
@@ -17,7 +17,7 @@
// | |
// +----------------------------------------------------------------------+
//
-// $Id: common.php,v 1.60 2001/08/21 02:44:21 chagenbu Exp $
+// $Id: common.php,v 1.61 2001/08/23 02:36:55 cox Exp $
//
// Base class for DB implementations.
//
@@ -86,16 +86,22 @@
*/
function quoteString($string)
{
- return $this->quote($string);
+ $string = $this->quote($string);
+ if ($string{0} == "'") {
+ return substr($string, 1, -1);
+ }
+ return $string;
}
/**
- * Quotes a string so it can be safely used within string delimiters
- * in a query. Other backend quote styles should override this method.
+ * Quotes a string so it can be safely used in a query. It will return
+ * the string with single quotes around. Other backend quote styles
+ * should override this method.
*
* @param $string the input string to quote
*
- * @return string the quoted string
+ * @return string The NULL string or the string quotes
+ * in magic_quote_sybase style
*/
function quote($string)
{