*/
public function strencode( $s ) {
// Should not be called by us
-
return str_replace( "'", "''", $s );
}
protected function mysqlRealEscapeString( $s ) {
$conn = $this->getBindingHandle();
- return mysql_real_escape_string( $s, $conn );
+ return mysql_real_escape_string( (string)$s, $conn );
}
}
protected function mysqlRealEscapeString( $s ) {
$conn = $this->getBindingHandle();
- return $conn->real_escape_string( $s );
+ return $conn->real_escape_string( (string)$s );
}
/**
public function strencode( $s ) {
// Should not be called by us
- return pg_escape_string( $this->getBindingHandle(), $s );
+ return pg_escape_string( $this->getBindingHandle(), (string)$s );
}
public function addQuotes( $s ) {
return 'DEFAULT';
}
- return "'" . pg_escape_string( $conn, $s ) . "'";
+ return "'" . pg_escape_string( $conn, (string)$s ) . "'";
}
/**
return "x'" . bin2hex( $s->fetch() ) . "'";
} elseif ( is_bool( $s ) ) {
return (int)$s;
- } elseif ( strpos( $s, "\0" ) !== false ) {
+ } elseif ( strpos( (string)$s, "\0" ) !== false ) {
// SQLite doesn't support \0 in strings, so use the hex representation as a workaround.
// This is a known limitation of SQLite's mprintf function which PDO
// should work around, but doesn't. I have reported this to php.net as bug #63419:
'For consistency all binary data should have been ' .
'first processed with self::encodeBlob()'
);
- return "x'" . bin2hex( $s ) . "'";
+ return "x'" . bin2hex( (string)$s ) . "'";
} else {
- return $this->mConn->quote( $s );
+ return $this->mConn->quote( (string)$s );
}
}