User tests: Successful: Unsuccessful:
Under some circumstances a search for a word can result in a "PHP Fatal error: utf8_strpos: Offset must be an integer". This is because the floor function used to calculate the offset can sometimes return a float rather than an int.
The return value from the floor is now cast to an int to make sure that the offset (the 3rd argument) passed to JString::strpos, which becomes the offset argument to utf8_strpos, is always an int.
This may be tricky to replicate but this is how I encountered the problem in the first place...
This should throw the error on one of the search results. For me it happened on "Modules" and "Sample Sites".
Apply this PR and repeat the test.
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
Category | ⇒ | Search |
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-05-08 09:56:46 |
Closed_By | ⇒ | wilsonge |
Milestone |
Added: |
Milestone |
Added: |
Milestone |
Removed: |
I have tested this item successfully on 4fb9192
One more thing: This might be PHP7-related. I don't have access to an earlier PHP release at the moment to test it, but it's strange that I haven't seen this issue until running on PHP7 for the first time.
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10303.