Make WordPress Core

Opened 9 months ago

Closed 9 months ago

#63219 closed defect (bug) (fixed)

Minor Code Improvement: Adjust $mailserver_url Condition Order in wp-mail.php

Reported by: dilipbheda's profile dilipbheda Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 6.9 Priority: normal
Severity: normal Version:
Component: Mail Keywords: has-patch
Focuses: Cc:

Description

Reordered the condition in the $mailserver_url check to prioritize the empty() check.

Reason for Change:

  • Improves readability and logic consistency by checking for an empty value first.
  • Prevents unnecessary string comparison if $mailserver_url is empty.

It follows a common best practice of checking for an empty value before doing a specific comparison.

Change History (3)

This ticket was mentioned in PR #8639 on WordPress/wordpress-develop by @dilipbheda.


9 months ago
#1

#2 @mukesh27
9 months ago

  • Milestone changed from Awaiting Review to 6.9

Thanks for ticket and PR.

Move to 6.9

#3 @SergeyBiryukov
9 months ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 60122:

Coding Standards: Check for an empty mail server URL first in wp-mail.php.

This follows a common best practice of checking for an empty value before doing a specific comparison.

Follow-up to [39772].

Props dilipbheda, mukesh27.
Fixes #63219.

Note: See TracTickets for help on using tickets.