WordPress.org

Make WordPress Core

Opened 13 months ago

Closed 5 weeks ago

#47796 closed defect (bug) (fixed)

uninstall_plugin should do an include_once not include

Reported by: pcfreak30 Owned by: SergeyBiryukov
Milestone: 5.5 Priority: normal
Severity: normal Version:
Component: Plugins Keywords: has-patch
Focuses: Cc:

Description

This seems to be an edge case, but it is possible for a plugin file to already be loaded when uninstall_plugin is run (like if done programmatically).

This can cause a fatal, and the simple solution is to use include_once.

Attachments (1)

47796.diff (843 bytes) - added by valchovski 10 months ago.

Download all attachments as: .zip

Change History (5)

#1 @ianbelanger
13 months ago

  • Summary changed from uninstall_plugin should do an include_one not include to uninstall_plugin should do an include_once not include
  • Version trunk deleted

@valchovski
10 months ago

#2 @valchovski
10 months ago

  • Keywords has-patch added; needs-patch removed

Hey!

Updated both include calls to include_once instead in the uninstall_plugin function

#3 @SergeyBiryukov
5 months ago

  • Milestone changed from Awaiting Review to 5.5
  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

#4 @SergeyBiryukov
5 weeks ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 48326:

Plugins: Use include_once instead of include in uninstall_plugin(), in case the plugin file is already included.

Props valchovski, pcfreak30.
Fixes #47796.

Note: See TracTickets for help on using tickets.