Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello,
the block_example.module file contains block_example_block_view_alter function to provide example of the hook operations. In it a string search is performed using stristr
.
Using multibyte string operations is currently best practice. The patch attached fixes that.
Comment | File | Size | Author |
---|---|---|---|
#5 | use-unicode-strpos-2628916-5.patch | 998 bytes | vaibhavjain |
| |||
#2 | example-multibyte_str_in_block_example-2628916-2.patch | 988 bytes | tassos |
|
Comments
Comment #2
tassos CreditAttribution: tassos at Cameron and Wilding Ltd commentedRolling out the patch.
Comment #3
Mile23Comment #4
Mile23Nice catch on multibyte, but it looks like we're only ever using this for logic and not to get the string back. Therefore we should use
Unicode::strpos()
.Comment #5
vaibhavjainAttaching updated patch.
No Interdiff attached, as it was not required.
Comment #7
Mile23Thanks!
Comment #8
Mile23We'll need to revert this for #2971229: Evaluate Unicode, mb_* usages after 8.6.x deprecations