Make WordPress Core

Opened 5 years ago

Closed 4 years ago

#47796 closed defect (bug) (fixed)

uninstall_plugin should do an include_once not include

Reported by: pcfreak30's profile pcfreak30 Owned by: sergeybiryukov's profile 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 5 years ago.

Download all attachments as: .zip

Change History (5)

#1 @ianbelanger
5 years 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
5 years ago

#2 @valchovski
5 years 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 years ago

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

#4 @SergeyBiryukov
4 years 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.