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

FIX Replace substr with mb_substr to get the correct position #8922

Merged
merged 1 commit into from Apr 15, 2019

Conversation

lhalaa
Copy link
Contributor

@lhalaa lhalaa commented Apr 15, 2019

Example content:
Screen Shot 2019-04-15 at 16 42 29

We're using DBText::ContextSummary() for search results and noticed that the summary didn't contain the keywords. This is due to not returning the correct position when extracting texts from a multibyte string. This fix will update the remaining substr to mb_substr.

Copy link
Contributor

@robbieaverill robbieaverill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@michalkleiner
Copy link
Contributor

A change that makes sense, but at the same time, is it a change in the public API/current vs future behaviour?

@ScopeyNZ
Copy link
Member

A change that makes sense, but at the same time, is it a change in the public API/current vs future behaviour?

Considering the existing use of multibyte safe string functions I think it's incredibly unlikely that this would be breaking any existing functionality. It's certainly not affecting public API.

Thanks for the PR @lhalaa

@michalkleiner
Copy link
Contributor

michalkleiner commented Apr 15, 2019

Just for my clarification, maybe I understand API changes differently — When I update a patch version and the frontend starts returning different content, that's not consider public API change? Or maybe not an API, but external behaviour change.

@robbieaverill
Copy link
Contributor

robbieaverill commented Apr 15, 2019

Usually the public API refers to public functions in our PHP code. Behavioural changes are considered also, but if a change fixes a bug it’s better to do it than to reject it and have people rely on broken behaviour.

@robbieaverill robbieaverill merged commit be9f012 into silverstripe:4.3 Apr 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants