J3 Issue ? ?
avatar f00x
f00x
28 Aug 2020

Steps to reproduce the issue

Text search standard search component.
Joomla! 3.9.21

Actual result

Warning: mb_strpos(): Offset not contained in string in \libraries\vendor\joomla\string\src\phputf8\mbstring\core.php on line 43

System information (as much as possible)

( ! ) SCREAM: Error suppression ignored for

1 | 0.0003 | 411400 | {main}( ) | ...\index.php:0
2 | 0.0985 | 4669160 | Joomla\CMS\Application\SiteApplication->execute( ) | ...\index.php:49
3 | 0.0985 | 4669160 | Joomla\CMS\Application\SiteApplication->doExecute( ) | ...\CMSApplication.php:196
4 | 0.2201 | 8451648 | Joomla\CMS\Application\SiteApplication->dispatch( $component = ??? ) | ...\SiteApplication.php:233
5 | 0.2310 | 8686552 | Joomla\CMS\Component\ComponentHelper::renderComponent( $option = 'com_search', $params = ??? ) | ...\SiteApplication.php:194
6 | 0.2319 | 8690864 | Joomla\CMS\Component\ComponentHelper::executeComponent( $path = 'C:\f00x\projects\golden.local/components/com_search/search.php' ) | ...\ComponentHelper.php:377
7 | 0.2320 | 8709064 | require_once( 'C:\f00x\projects\golden.local\components\com_search\search.php' ) | ...\ComponentHelper.php:402
8 | 0.2354 | 8891912 | SearchController->execute( $task = NULL ) | ...\search.php:13
9 | 0.2355 | 8891912 | SearchController->display( $cachable = ???, $urlparams = ??? ) | ...\BaseController.php:710
10 | 0.2355 | 8891912 | SearchController->display( $cachable = FALSE, $urlparams = FALSE ) | ...\controller.php:34
11 | 0.2479 | 9296176 | SearchViewSearch->display( $tpl = ??? ) | ...\BaseController.php:672
12 | 0.2959 | 10179144 | SearchViewSearch->highLight( $string = 'About', $needle = 'the', $searchWords = array (0 => 'the') ) | ...\view.html.php:153
13 | 0.2960 | 10179144 | SearchHelper::prepareSearchContent( $text = 'About', $searchword = 'the' ) | ...\view.html.php:219
14 | 0.2960 | 10179176 | SearchHelper::_smartSubstr( $text = 'About', $searchword = 'the' ) | ...\search.php:199
15 | 0.2961 | 10179208 | Joomla\String\StringHelper::strpos( $str = 'About', $search = ' ', $offset = 200 ) | ...\search.php:293
16 | 0.2961 | 10179208 | utf8_strpos( $str = 'About', $search = ' ', $offset = 200 ) | ...\StringHelper.php:185
17 | 0.2961 | 10179208 | mb_strpos ( 'About', ' ', 200 ) | ...\core.php:43

$offset = | int 200
$search = | string ' ' (length=1)
$str = | string 'About' (length=5)

Additional comments

Correcting by change, but this is not the best solution
f135851

avatar f00x f00x - open - 28 Aug 2020
avatar joomla-cms-bot joomla-cms-bot - change - 28 Aug 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 28 Aug 2020
avatar ReLater
ReLater - comment - 28 Aug 2020

I can't reproduce your find. I made several searches with com_search, error_reporting "maximum" and don't see any entries in my error log afterwards.

Perhaps your testing instructions aren't sufficient?

PHP7.4
Joomla3.9.21

avatar SharkyKZ
SharkyKZ - comment - 10 Sep 2020

I was able to reproduce this on PHP 8 or by removing error suppression on older versions. Searched for content on site with testing sample data installed.

@f00x Your suggestion #29008 (comment) works fine. Do you want to make a PR?

avatar SharkyKZ SharkyKZ - change - 26 Oct 2020
Labels Added: J3 Issue ?
avatar SharkyKZ SharkyKZ - labeled - 26 Oct 2020
avatar SharkyKZ SharkyKZ - labeled - 26 Oct 2020
avatar SharkyKZ
SharkyKZ - comment - 26 Oct 2020

@f00x Are you going to make the PR?

avatar HLeithner
HLeithner - comment - 20 Nov 2020

@f00x can you please test #31444 closing this issue

avatar HLeithner HLeithner - change - 20 Nov 2020
Status New Closed
Closed_Date 0000-00-00 00:00:00 2020-11-20 22:47:33
Closed_By HLeithner
avatar HLeithner HLeithner - close - 20 Nov 2020

Add a Comment

Login with GitHub to post a comment