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

mb_strpos(): Offset not contained in string #65

Open
mprofitlich opened this issue Feb 17, 2021 · 3 comments
Open

mb_strpos(): Offset not contained in string #65

mprofitlich opened this issue Feb 17, 2021 · 3 comments

Comments

@mprofitlich
Copy link

I sometimes got the PHP error mb_strpos(): Offset not contained in string. I cannot find out when it happens and when not.

There’s an old thread from 2012 on the Symphony forum in which Nikolai Shmakov gives a solution that also works for me:

Replace line 383 in class.search_index_php
$p = $match[0][1];
against
$p = $match[0][1]/2;

@animaux
Copy link
Contributor

animaux commented Feb 17, 2021

I think I used that too some time ago. But if I remember correctly, the side-effect was that the extracts were offset from the actual keywords.

@mprofitlich
Copy link
Author

That’s true. The results are still correct but the extract shown often doesn’t show the keyword (which is there but at another place in the text). How did you solve or circumvent the problem?

@animaux
Copy link
Contributor

animaux commented Feb 17, 2021

¯\_(ツ)_/¯

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