Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

strpos(): Argument #1 ($haystack) must be of type string, array given Range.php #18794

Closed
tsteur opened this issue Feb 15, 2022 · 1 comment
Closed
Labels
Bug For errors / faults / flaws / inconsistencies etc. Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Milestone

Comments

@tsteur
Copy link
Member

tsteur commented Feb 15, 2022

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

@tsteur tsteur added Bug For errors / faults / flaws / inconsistencies etc. Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement. labels Feb 15, 2022
@tsteur tsteur added this to the 4.9.0 milestone Feb 15, 2022
@sgiehl
Copy link
Member

sgiehl commented Feb 15, 2022

This was also fixed with #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

@sgiehl sgiehl closed this as completed Feb 15, 2022
@sgiehl sgiehl modified the milestones: 4.9.0, 4.8.0 Feb 15, 2022
@justinvelluppillai justinvelluppillai added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

No branches or pull requests

3 participants