@tsteur opened this Issue on February 15th 2022 Member

Error: {"message":"strpos(): Argument #1 ($haystack) must be of type string, array given","file":"\/core\/Period\/Range.php","line":525,"request_id":"a48e4","backtrace":" on \/core\/Period\/Range.php(525)\n#0 \/core\/Period\/Range.php(525): strpos(Array, '-')\n#1 \/plugins\/ImageGraph\/ImageGraph.php(92): Piwik\Period\Range::getRelativeToEndDate('day', 'last30', Array, Object(Piwik\Site))\n#2 [internal function]: Piwik\Plugins\ImageGraph\ImageGraph->getReportMetadata(Array, Array)\n#3 \/core\/EventDispatcher.php(141): call_user_func_array(Array, Array)\n#4 \/core\/Piwik.php(845): Piwik\EventDispatcher->postEvent('API.getReportMe...', Array, false, Array)\n#5 \/plugins\/API\/ProcessedReport.php(221): Piwik\Piwik::postEvent('API.getReportMe...', Array)\n#6 \/plugins\/API\/API.php(276): Piwik\Plugins\API\ProcessedReport->getReportMetadata('1', 'day', Array, false, false)\n#7 \/core\/Plugin\/Controller.php(429): Piwik\Plugins\API\API->getReportMetadata('1', 'day', Array)\n#8 \/plugins\/VisitsSummary\/Controller.php(121): Piwik\Plugin\Controller->getLastUnitGraphAcrossPlugins('VisitsSummary', 'getEvolutionGra...', false, Array, 'This is an over...')\n#9 [internal function]: Piwik\Plugins\VisitsSummary\Controller->getEvolutionGraph()\n#10 \/core\/FrontController.php(623): call_user_func_array(Array, Array)\n#11 \/core\/FrontController.php(168): Piwik\FrontController->doDispatch('VisitsSummary', 'getEvolutionGra...', Array)

URL: https://demo.matomo.cloud/index.php?action=getEvolutionGraph&date%5B0%5D=exp&date%5B1%5D=%3D1%E9%8E%88%27%22%5C%28&disableLink=0&forceView=1&idSite=1&module=VisitsSummary&period=day&viewDataTable=graphEvolution&widget=1

Referrer: https://demo.matomo.cloud/index.php?module=CoreHome&action=index&idSite=1&period=day&date=yesterday

GET: {"action":"getEvolutionGraph","date":["exp","=1\u9388'\"\("],"disableLink":"0","forceView":"1","idSite":"1","module":"VisitsSummary","period":"day","viewDataTable":"graphEvolution","widget":"1"}

Happens on PHP 8

@sgiehl commented on February 15th 2022 Member

This was also fixed with https://github.com/matomo-org/matomo/issues/18639 and now throws a Date format must be: YYYY-MM-DD, or 'today' or 'yesterday' or any keyword supported by the strtotime function (see http://php.net/strtotime for more information): Array

This Issue was closed on February 15th 2022
Powered by GitHub Issue Mirror