コード例 #1
0
 /**
  * Get a database escaped string. For LIKE statemends: $db->Quote( $db->getEscaped( $text, true ) . '%', false )
  *
  * @param  string  $text
  * @param  boolean $escapeForLike : escape also % and _ wildcards for LIKE statements with % or _ in search strings  (since CB 1.2.3)
  * @return string
  */
 function getEscaped($text, $escapeForLike = false)
 {
     if (checkJversion() >= 2) {
         $result = $this->_db->escape($text);
     } else {
         $result = $this->_db->getEscaped($text);
     }
     if ($escapeForLike) {
         $result = str_replace(array('%', '_'), array("\\%", "\\_"), $result);
     }
     return $result;
 }