function DatabaseSchema_mysql::prepareComment

Overrides DatabaseSchema::prepareComment

2 calls to DatabaseSchema_mysql::prepareComment()
DatabaseSchema_mysql::createFieldSql in includes/database/mysql/schema.inc
Create an SQL string for a field to be used in table creation or alteration.
DatabaseSchema_mysql::createTableSql in includes/database/mysql/schema.inc
Generate SQL to create a new table from a Drupal schema definition.

File

includes/database/mysql/schema.inc, line 480

Class

DatabaseSchema_mysql

Code

public function prepareComment($comment, $length = NULL) {
    // Work around a bug in some versions of PDO, see http://bugs.php.net/bug.php?id=41125
    $comment = str_replace("'", '’', $comment);
    // Truncate comment to maximum comment length.
    if (isset($length)) {
        // Add table prefixes before truncating.
        $comment = truncate_utf8($this->connection
            ->prefixTables($comment), $length, TRUE, TRUE);
    }
    return $this->connection
        ->quote($comment);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.