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

FIX Handle admin_email array config #10258

Merged

Conversation

emteknetnz
Copy link
Member

Issue #10257

// https://docs.silverstripe.org/en/4/developer_guides/email/#administrator-emails
$adminEmail = $this->config()->get('admin_email');
if (is_array($adminEmail) && count($adminEmail) > 0) {
$defaultFrom = array_keys($adminEmail)[0];
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
$defaultFrom = array_keys($adminEmail)[0];
$defaultFrom = array_key_first($adminEmail);

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated

Copy link
Member Author

Choose a reason for hiding this comment

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

Reverted, PHP 7.1 (which 4.9 supports) doesn't have the array_key_first, it's new with php 7.3.0

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, ok, I thought we dropped support below 7.4 now but didn't realise 4.9 still has it. All good.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah 4.10 was when older PHP support was dropped.

@michalkleiner michalkleiner merged commit e1dd712 into silverstripe:4.9 Mar 9, 2022
@emteknetnz emteknetnz deleted the pulls/4.9/email-array branch March 9, 2022 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants