Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#28613 closed defect (bug) (duplicate)

class_exists(classname) should be class_exists(classname, false) in a few places

Reported by: jcjcc's profile jcjcc Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.0
Component: Bootstrap/Load Keywords:
Focuses: Cc:

Description

Five files contain calls to class_exists without the second parameter set to false. When an autoloader is registered but the class doesn't exist, a fatal exception is thrown (see #13436) unless this second parameter is set.

The incorrect calls to "class_exists" (ie. with only one argument) are in wp-includes/pomo/{entry, translations, streams, mo}.php.

One more instance in wp-includes/pluggable-deprecated.php.

The changes are very simple and should look like this (here is the one instance in pluggable-deprecated.php):

if ( ! class_exists( 'wp_atom_server' ) ) {

becomes

if ( ! class_exists( 'wp_atom_server', false ) ) {

#13436 mentions several more instances, but I did the above changes by hand and the site loads fine now. (It would be probably to go through and look at every instance of class_exists, though.)

Change History (1)

#1 @SergeyBiryukov
11 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #13436.

Note: See TracTickets for help on using tickets.