Make WordPress Core

Opened 7 years ago

Closed 6 years ago

#47796 closed defect (bug) (fixed)

uninstall_plugin should do an include_once not include

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

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 7 years ago.

Download all attachments as: .zip

Change History (5)

#1 @ianbelanger
7 years ago

  • Summary uninstall_plugin should do an include_one not include → uninstall_plugin should do an include_once not include
  • Version trunk

@valchovski
7 years ago

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

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

#4 @SergeyBiryukov
6 years ago

  • Resolution → fixed
  • Status reviewing → 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.