예제 #1
0
파일: mssql.php 프로젝트: Dulciane/jaws
 /**
  * Quotes a string so it can be safely used in a query. It will quote
  * the text so it can safely be used within a query.
  *
  * @param string $text             the input string to quote
  * @param bool   $escape_wildcards flag
  *
  * @return string  quoted string
  * @access public
  */
 function escape($text, $escape_wildcards = false)
 {
     $text = parent::escape($text, $escape_wildcards);
     // http://pear.php.net/bugs/bug.php?id=16118
     // http://support.microsoft.com/kb/164291
     return preg_replace("/\\\\(\r\n|\r|\n)/", '\\\\$1', $text);
 }
 /**
  * Tests that the MDB2::escape() method correctly escapes strings.
  */
 function test_escape()
 {
     $tmp = $this->db->string_quoting;
     $this->string_quoting['escape'] = '\\';
     $this->string_quoting['end'] = '"';
     $text = 'xxx"z"xxx';
     $this->assertEquals('xxx\\"z\\"xxx', MDB2_Driver_Common::escape($text), 'escape');
     $this->db->string_quoting = $tmp;
 }
예제 #3
0
파일: ibase.php 프로젝트: Dulciane/jaws
 /**
  * Quotes a string so it can be safely used in a query. It will quote
  * the text so it can safely be used within a query.
  *
  * @param   string  the input string to quote
  * @param   bool    escape wildcards
  *
  * @return  string  quoted string
  *
  * @access  public
  */
 function escape($text, $escape_wildcards = false)
 {
     //Remove a NULL-character (may break queries when inserted):
     $text = str_replace("", '', $text);
     return parent::escape($text, $escape_wildcards);
 }