Skip to content

fix: correct getHostname() fallback logic in Email class - #9587

Merged
michalsn merged 1 commit into
codeigniter4:developfrom
michalsn:fix/get-hostname
May 31, 2025
Merged

fix: correct getHostname() fallback logic in Email class#9587
michalsn merged 1 commit into
codeigniter4:developfrom
michalsn:fix/get-hostname

Conversation

@michalsn

Copy link
Copy Markdown
Member

Description
This PR fixes the getHostname() method in the Email class to ensure it correctly falls back to the server address or system hostname in order of availability. In some environments, such as Google App Engine, $_SERVER['SERVER_NAME'] may be set but empty.

Problem reported here: #9448 (comment)

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@michalsnmichalsn added the bug Verified issues on the current code behavior or pull requests that will fix them label May 29, 2025
@github-actionsgithub-actionsBot added the stale Pull requests with conflicts label May 31, 2025
@github-actions

Copy link
Copy Markdown

👋 Hi, @michalsn!

We detected conflicts in your PR against the base branch 🙊
You may want to sync 🔄 your branch with upstream!

Ref: Syncing Your Branch

@datamwebdatamweb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The PR looks good and the test is clear and logical. Just needs a rebase before merge.

@michalsn
michalsn merged commit 113a0fd into codeigniter4:developMay 31, 2025
@michalsn

Copy link
Copy Markdown
MemberAuthor

Thank you @paulbalandan and @datamweb

@michalsn
michalsn deleted the fix/get-hostname branch May 31, 2025 17:58
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugVerified issues on the current code behavior or pull requests that will fix themstalePull requests with conflicts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@michalsn@datamweb@paulbalandan