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

PHP 8.1 compatibility, fix "Deprecated - explode(): Passing null to parameter" #17693

Merged
merged 2 commits into from Jun 18, 2021

Conversation

Findus23
Copy link
Member

@Findus23 Findus23 commented Jun 18, 2021

see #17686

$ids can be null because of

$archiver->shouldSkipSpecifiedSites = self::getSitesListOption($input, "skip-idsites");

private static function getSitesListOption(InputInterface $input, $optionName)
{
return Site::getIdSitesFromIdSitesString($input->getOption($optionName));
}

when no command line arg is passed.

I'm not completely sure if this is the correct fix, but it seems reasonable to me.

Also changed a similar case with $segmentIds.

Review

  • Functional review done
  • Potential edge cases thought about (behavior of the code with strange input, with strange internal state or possible interactions with other Matomo subsystems)
  • Usability review done (is anything maybe unclear or think about anything that would cause people to reach out to support)
  • Security review done see checklist
  • Code review done
  • Tests were added if useful/possible
  • Reviewed for breaking changes
  • Developer changelog updated if needed
  • Documentation added if needed
  • Existing documentation updated if needed

@Findus23 Findus23 added Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change. Needs Review PRs that need a code review labels Jun 18, 2021
@Findus23 Findus23 mentioned this pull request Jun 18, 2021
38 tasks
core/Site.php Show resolved Hide resolved
Copy link
Member

@sgiehl sgiehl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@diosmosis diosmosis merged commit 3e4aaf4 into 4.x-dev Jun 18, 2021
@diosmosis diosmosis deleted the allow-empty-sites-list branch June 18, 2021 18:08
@mattab mattab changed the title allow empty site list PHP 8.1 compatibility, fix "Deprecated - explode(): Passing null to parameter" Jul 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants