Steps to reproduce the issue
- Install Joomla 3.9.24 on PHP 8 (Xampp 8 on Win 10 in my case). #31444 is already merged there. This is a new issue!
- Create an article with title
Modulpositionen mit Bootstrap 2 ausrichten - Die magische Zwölf
-
- The German Umlaut
ö
is important.
- Enter
Modulstil
inside the editor and save article.
- Go to frontend and use a com_search search form (e.g. modul).
- Enter
Modulstil
as search word.
Test instructions addition 2021-03-15
- Be aware that the error occurs when the Title of the article does NOT contain the search word.
- And only if it contains an utf8 character like German
ö
Expected result
- Search results displayed without errors
Actual result
Fatal error 0 mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
Call stack
| Function | Location
1 | () | JROOT\libraries\vendor\joomla\string\src\phputf8\mbstring\core.php:43
2 | mb_strpos() | JROOT\libraries\vendor\joomla\string\src\phputf8\mbstring\core.php:43
3 | utf8_strpos() | JROOT\libraries\vendor\joomla\string\src\StringHelper.php:183
4 | Joomla\String\StringHelper::strpos() | JROOT\administrator\components\com_search\helpers\search.php:350
5 | SearchHelper::_smartSubstr() | JROOT\administrator\components\com_search\helpers\search.php:199
6 | SearchHelper::prepareSearchContent() | JROOT\components\com_search\views\search\view.html.php:219
7 | SearchViewSearch->highLight() | JROOT\components\com_search\views\search\view.html.php:153
8 | SearchViewSearch->display() | JROOT\libraries\src\MVC\Controller\BaseController.php:672
9 | Joomla\CMS\MVC\Controller\BaseController->display() | JROOT\components\com_search\controller.php:34
10 | SearchController->display() | JROOT\libraries\src\MVC\Controller\BaseController.php:710
11 | Joomla\CMS\MVC\Controller\BaseController->execute() | JROOT\components\com_search\search.php:13
12 | require_once() | JROOT\libraries\src\Component\ComponentHelper.php:402
13 | Joomla\CMS\Component\ComponentHelper::executeComponent() | JROOT\libraries\src\Component\ComponentHelper.php:377
14 | Joomla\CMS\Component\ComponentHelper::renderComponent() | JROOT\libraries\src\Application\SiteApplication.php:194
15 | Joomla\CMS\Application\SiteApplication->dispatch() | JROOT\libraries\src\Application\SiteApplication.php:233
16 | Joomla\CMS\Application\SiteApplication->doExecute() | JROOT\libraries\src\Application\CMSApplication.php:196
17 | Joomla\CMS\Application\CMSApplication->execute() | JROOT\index.php:49
Additional comment
Closing as we have a PR