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

Oracle quoting fix for values with single quotes #7177

Closed
wants to merge 3 commits into from
Closed

Oracle quoting fix for values with single quotes #7177

wants to merge 3 commits into from

Conversation

marcelto
Copy link
Contributor

@marcelto marcelto commented Feb 2, 2015

Single quotes need to be handled differently

$str = 'foo 'bar';
echo 'select '.$oracleAdapterPlatform->quoteTrustedValue($str).'from dual';//sql string won't run in Oracle(11.2.0.4.0 in this case)

outputs: select 'foo 'bar' from dual

needs to output: select 'foo ''bar' from dual

Single quotes need to be handled differently

$str = 'foo \'bar';
echo 'select '.$oracleAdapterPlatform->quoteTrustedValue($str).'from dual';//sql string won't run in Oracle(11.2.0.4.0 in this case)

outputs: select 'foo \'bar' from dual

needs to output: select 'foo ''bar' from dual
@macnibblet
Copy link
Contributor

Can you add a test case ?

@marcelto
Copy link
Contributor Author

marcelto commented Feb 2, 2015

Sorry I'm still a little new to pull requests. Do you mean an assertion in the Oracle unit test?

@macnibblet
Copy link
Contributor

You need to add a test case in https://github.com/zendframework/zf2/blob/master/tests/ZendTest/Db/Adapter/Platform/OracleTest.php so we don't have any regressions.

@marcelto
Copy link
Contributor Author

marcelto commented Feb 2, 2015

Ah yes, I see.

@marcelto
Copy link
Contributor Author

marcelto commented Feb 2, 2015

Priority issue at work, will fix delete assertions in unit test asap

@macnibblet
Copy link
Contributor

👍

@Ocramius Ocramius added this to the 2.3.5 milestone Feb 2, 2015
@Ocramius Ocramius self-assigned this Feb 2, 2015
@weierophinney weierophinney modified the milestones: 2.3.5, 2.3.6, 2.4.0 Feb 18, 2015
weierophinney added a commit that referenced this pull request Feb 25, 2015
Oracle quoting fix for values with single quotes
weierophinney added a commit that referenced this pull request Feb 25, 2015
@weierophinney
Copy link
Member

Merged to develop for release with 2.4.

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