Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't escape quote in orderby with the function INSTR() #2799

Closed
aleblanc opened this issue May 14, 2024 · 1 comment
Closed

Can't escape quote in orderby with the function INSTR() #2799

aleblanc opened this issue May 14, 2024 · 1 comment

Comments

@aleblanc
Copy link

aleblanc commented May 14, 2024

When I add a quote in the function INSTR() like this :

$value = " string with quote ' that make error ";
$queryBuilder->orderBy('INSTR(field, '.$this->getEntityManager()->getConnection()->quote($value).')');

This code generate this error :

"[Syntax Error] line 0, col 131: Error: Expected Doctrine\\ORM\\Query\\Lexer::T_CLOSE_PARENTHESIS, got 'that'"

NB: If I remove the quote in the string the query works.

Environnement :

            "name": "gedmo/doctrine-extensions",
            "version": "v3.15.0",

            "name": "doctrine/orm",
            "version": "2.19.5",
@mbabker
Copy link
Contributor

mbabker commented May 14, 2024

This doesn't look to be a bug related to this package's functionality? Seems better reported to https://github.com/doctrine/orm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants