Exemple #1
0
 /**
  * Return an echapped input to use into an SQL query
  *
  * @param string $input The string to echap
  * @return string echapped query
  * @access public
  */
 static function echap($input)
 {
     try {
         $db = is_array(self::$_connection) ? current(self::$_connection) : new PDO(APPLICATION_DB_DSN, APPLICATION_DB_USER, APPLICATION_DB_PASSWORD, array(PDO::ATTR_PERSISTENT => APPLICATION_DB_PERSISTENT_CONNNECTION, PDO::ERRMODE_EXCEPTION => true, PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true));
     } catch (PDOException $e) {
         CMS_query::raiseError($e->getMessage());
         exit;
     }
     return io::substr($db->quote($input), 1, -1);
 }