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

Error binding parameters in MatchExpression #106

Open
evgen84 opened this issue Oct 5, 2018 · 0 comments
Open

Error binding parameters in MatchExpression #106

evgen84 opened this issue Oct 5, 2018 · 0 comments
Labels
help wanted status:ready for adoption Feel free to implement this issue. type:bug Bug

Comments

@evgen84
Copy link

evgen84 commented Oct 5, 2018

What steps will reproduce the problem?

The problem appears only in case parameter contains \ as last symbol. Seems it's in the
yii\sphinx\MatchBuilder::parseParams(). When changing preg_replace() to str_replace() it works but it seems it's not correct to use str_replace() based on comment:

// $model extends \yii\sphinx\ActiveRecord
$value = '543524\\';
$data = $model::find()
        ->match(new MatchExpression(['title' => $value]))
        ->all();

What's expected?

result set

What do you get instead?

Exception 'yii\db\Exception' with message 'SQLSTATE[42000]: Syntax error or access violation: ...unexpected $end near

Additional info

Q A
Yii version 2.0.14.2
Yii Sphinx version 2.0.11
Sphinx server version 2.2.10
PHP version 7.0.31
Operating system ubuntu16.04
@samdark samdark added type:bug Bug status:ready for adoption Feel free to implement this issue. labels Oct 5, 2018
@samdark samdark changed the title Ошибка биндинга параметров в MatchExpression Error binding parameters in MatchExpression Aug 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted status:ready for adoption Feel free to implement this issue. type:bug Bug
Projects
None yet
Development

No branches or pull requests

2 participants