fix(zend-mail): drop unused name argument to addBcc method - #142
Open
faisalahammad wants to merge 1 commit into
Open
fix(zend-mail): drop unused name argument to addBcc method#142faisalahammad wants to merge 1 commit into
faisalahammad wants to merge 1 commit into
Conversation
Vendor Zend_Zend_Mail::addBcc() signature accepts only ($email), so PHP 8 warns on the two-argument call here. The vendor method internally passes '' as the name anyway, so the recipient name was already lost. Removing the second arg eliminates the warning without behavior change. Fixes wpexpertsio#104
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PostmanZendMailEnginepasses$recipient->getName()as a second argument toPostman_Zend_Mail::addBcc(), but the vendor method signature only accepts$email. PHP 8 raises warnings for excess non-variadic arguments.Fixes #104
Changes
Postman/Postman-Mail/PostmanZendMailEngine.php
Before:
After:
Why: The Zend vendor
addBcc()accepts only$emailand internally passes `` for the name when calling_addRecipientAndHeader. The recipient name was already discarded in practice. Removing the second arg eliminate the PHP 8 warning without changing behavior.Testing
Test 1: Syntax check
php -l Postman/Postman-Mail/PostmanZendMailEngine.phpResult: No syntax errors detected.
Test 2: PHP 8 warning regression (WP + PHP 8.1+)
WP_DEBUG_LOGfor anyaddBccrelated warningsResult: No warnings logged.
Test 3: Bcc delivery
Result: Delivery works (same behavior as PHP 7).
Test 4: Cc regression check
Result: Cc loop unchanged, names render correctly.