Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#52369 closed defect (bug) (fixed)

Deprecated wp-includes/SMTP.php should use require_once to include the new namespaced class

Reported by: greatsaltlake Owned by: audrasjb
Priority: normal Milestone: 5.7
Component: Mail Version: 5.5
Severity: normal Keywords: good-first-bug has-patch
Cc: Focuses:

Description

Currently the deprecated file uses

<?php
require __DIR__ . '/PHPMailer/SMTP.php';

which can lead to a fatal error if that class or the deprecated file has already been loaded.

Attachments (1)

52369.diff​ (507 bytes ) - added by oellin 6 years ago.

Download all attachments as: .zip

Change History (6)

#1 @audrasjb
6 years ago

  • Component General → External Libraries
  • Keywords needs-patch good-first-bug added
  • Milestone Awaiting Review → 5.7
  • Owner set to audrasjb
  • Status new → accepted
  • Version 5.6 → 5.5

Hi @greatsaltlake, welcome to WordPress Core Trac and thank you for opening this ticket.

The bug report makes sense to me.

Moving it to the current milestone (5.7) and adding the good-first-bug workflow keyword as this is a good ticket to onboard people for their very first contribution.

I'm unsure about moving this to External libraries component, though. @SergeyBiryukov as WP 5.7 Core Tech Lead, I’d rely on you for moving this to the best component if needed :)

#2 @SergeyBiryukov
6 years ago

  • Component External Libraries → Mail

Good catch, introduced in [48033] / #41750.

This was solved for wp-includes/class-phpmailer.php in [48530] / #50716, but not for class-smtp.php.

Since wp-includes/class-smtp.php is no longer an external file, moving to the Mail component.

#3 follow-up: @oellin
6 years ago

  • Keywords has-patch added; needs-patch removed

Hi,

This is my first contribution.

In this patch i replaced require with require_once.

#4 in reply to: ↑ 3 @SergeyBiryukov
6 years ago

Replying to oellin:

This is my first contribution.

The patch looks great, thank you :)

#5 @SergeyBiryukov
6 years ago

  • Resolution → fixed
  • Status accepted → closed

In 50022:

Mail: Make sure the SMTP class is only required once if a plugin requires wp-includes/class-smtp.php directly.

Follow-up to [48033], [48530].

Props oellin, greatsaltlake, audrasjb.
Fixes #52369. See #50716, #41750.

Note: See TracTickets for help on using tickets.