Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Fixed charset support for Pdo_Pgsql. #6033

Merged
merged 1 commit into from
May 12, 2014
Merged

Fixed charset support for Pdo_Pgsql. #6033

merged 1 commit into from
May 12, 2014

Conversation

hschletz
Copy link
Contributor

Starting with Release 2.3, the "charset" option is passed to PDO. This is not supported for all PDO drivers. In particular, The pgsql driver throws an exception if the DSN contains the "charset" option.

I created a workaround for Pdo_Pgsql. Please note that the quoting of $charset is not 100% secure if the charset is not already set. Either set the encoding to a default charset before setting the final charset, validate the string to be plain ASCII, or document that the value cannot be trusted in regards to possible SQL injection.

For uniform charset handling, other drivers (PDO and non-PDO) may need special treatment as well.

@ralphschindler
Copy link
Member

Yep, charset is not a portable key in the dsn. I'll get this merged in in the next week, I also looked through the docs and noticed there are a few other places where charset might need to be omited for a given driver.

@Ocramius Ocramius added the Db label Apr 2, 2014
@weierophinney weierophinney self-assigned this May 12, 2014
@weierophinney weierophinney added this to the 2.3.2 milestone May 12, 2014
weierophinney added a commit that referenced this pull request May 12, 2014
Fixed charset support for Pdo_Pgsql.
weierophinney added a commit that referenced this pull request May 12, 2014
@weierophinney weierophinney merged commit 6a41be4 into zendframework:master May 12, 2014
weierophinney added a commit that referenced this pull request May 12, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants