WordPress.org

Make WordPress Core

Changeset 34348


Ignore:
Timestamp:
09/20/2015 03:51:55 AM (5 years ago)
Author:
wonderboymusic
Message:

Pass false as the 2nd argument to class_exists() to disable autoloading and to not cause problems for those who define __autoload().

Fixes #20523.

Location:
trunk/src
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/ajax-actions.php

    r34313 r34348  
    11661166    $walker_class_name = apply_filters( 'wp_edit_nav_menu_walker', 'Walker_Nav_Menu_Edit', $_POST['menu'] );
    11671167
    1168     if ( ! class_exists( $walker_class_name ) )
     1168    if ( ! class_exists( $walker_class_name, false ) )
    11691169        wp_die( 0 );
    11701170
  • trunk/src/wp-admin/includes/deprecated.php

    r33671 r34348  
    317317}
    318318
    319 if ( !class_exists('WP_User_Search') ) :
     319if ( ! class_exists( 'WP_User_Search', false ) ) :
    320320/**
    321321 * WordPress User Search class.
     
    758758    static $num = 1;
    759759
    760     if ( ! class_exists('_WP_Editors' ) )
     760    if ( ! class_exists( '_WP_Editors', false ) )
    761761        require_once( ABSPATH . WPINC . '/class-wp-editor.php' );
    762762
  • trunk/src/wp-admin/includes/file.php

    r34291 r34348  
    560560     * @param bool $ziparchive Whether to use ZipArchive. Default true.
    561561     */
    562     if ( class_exists( 'ZipArchive' ) && apply_filters( 'unzip_file_use_ziparchive', true ) ) {
     562    if ( class_exists( 'ZipArchive', false ) && apply_filters( 'unzip_file_use_ziparchive', true ) ) {
    563563        $result = _unzip_file_ziparchive($file, $to, $needed_dirs);
    564564        if ( true === $result ) {
     
    849849        return false;
    850850
    851     if ( ! class_exists("WP_Filesystem_$method") ) {
     851    if ( ! class_exists( "WP_Filesystem_$method", false  ) ) {
    852852
    853853        /**
  • trunk/src/wp-admin/includes/media.php

    r34259 r34348  
    29752975    $metadata = array();
    29762976
    2977     if ( ! class_exists( 'getID3' ) )
     2977    if ( ! class_exists( 'getID3', false ) )
    29782978        require( ABSPATH . WPINC . '/ID3/getid3.php' );
    29792979    $id3 = new getID3();
     
    30303030    $metadata = array();
    30313031
    3032     if ( ! class_exists( 'getID3' ) )
     3032    if ( ! class_exists( 'getID3', false ) )
    30333033        require( ABSPATH . WPINC . '/ID3/getid3.php' );
    30343034    $id3 = new getID3();
  • trunk/src/wp-admin/includes/misc.php

    r33849 r34348  
    455455    if ( ! file_exists($filename) )
    456456        return false;
    457     if ( ! class_exists('DOMDocument') )
     457    if ( ! class_exists( 'DOMDocument', false ) ) {
    458458        return false;
     459    }
    459460
    460461    $doc = new DOMDocument();
     
    482483        return true;
    483484
    484     if ( ! class_exists('DOMDocument') )
     485    if ( ! class_exists( 'DOMDocument', false ) ) {
    485486        return false;
     487    }
    486488
    487489    $doc = new DOMDocument();
     
    512514 */
    513515function iis7_add_rewrite_rule($filename, $rewrite_rule) {
    514     if ( ! class_exists('DOMDocument') )
     516    if ( ! class_exists( 'DOMDocument', false ) ) {
    515517        return false;
     518    }
    516519
    517520    // If configuration file does not exist then we create one.
  • trunk/src/wp-admin/includes/nav-menu.php

    r34168 r34348  
    876876        $walker_class_name = apply_filters( 'wp_edit_nav_menu_walker', 'Walker_Nav_Menu_Edit', $menu_id );
    877877
    878         if ( class_exists( $walker_class_name ) )
     878        if ( class_exists( $walker_class_name, false ) )
    879879            $walker = new $walker_class_name;
    880880        else
  • trunk/src/wp-admin/includes/template-functions.php

    r34319 r34348  
    19111911 */
    19121912function convert_to_screen( $hook_name ) {
    1913     if ( ! class_exists( 'WP_Screen' ) ) {
     1913    if ( ! class_exists( 'WP_Screen', false ) ) {
    19141914        _doing_it_wrong( 'convert_to_screen(), add_meta_box()', __( "Likely direct inclusion of wp-admin/includes/template.php in order to use add_meta_box(). This is very wrong. Hook the add_meta_box() call into the add_meta_boxes action instead." ), '3.3' );
    19151915        return (object) array( 'id' => '_invalid', 'base' => '_are_belong_to_us' );
  • trunk/src/wp-includes/admin-bar.php

    r34170 r34348  
    3838     */
    3939    $admin_bar_class = apply_filters( 'wp_admin_bar_class', 'WP_Admin_Bar' );
    40     if ( class_exists( $admin_bar_class ) )
     40    if ( class_exists( $admin_bar_class, false ) )
    4141        $wp_admin_bar = new $admin_bar_class;
    4242    else
  • trunk/src/wp-includes/class-feed.php

    r32657 r34348  
    11<?php
    22
    3 if ( !class_exists('SimplePie') )
     3if ( ! class_exists( 'SimplePie', false ) )
    44    require_once( ABSPATH . WPINC . '/class-simplepie.php' );
    55
  • trunk/src/wp-includes/class-oembed.php

    r33831 r34348  
    490490     */
    491491    private function _parse_xml_body( $response_body ) {
    492         if ( ! function_exists( 'simplexml_import_dom' ) || ! class_exists( 'DOMDocument' ) )
     492        if ( ! function_exists( 'simplexml_import_dom' ) || ! class_exists( 'DOMDocument', false ) )
    493493            return false;
    494494
  • trunk/src/wp-includes/class-simplepie.php

    r29479 r34348  
    11<?php
    2 if ( ! class_exists( 'SimplePie' ) ) :
     2if ( ! class_exists( 'SimplePie', false ) ) :
    33
    44// Load classes we will need.
  • trunk/src/wp-includes/class-snoopy.php

    r33954 r34348  
    66_deprecated_file( basename( __FILE__ ), '3.0', WPINC . '/http.php' );
    77
    8 if ( !class_exists( 'Snoopy' ) ) :
     8if ( ! class_exists( 'Snoopy', false ) ) :
    99/*************************************************
    1010
  • trunk/src/wp-includes/class-wp-image-editor-imagick.php

    r33052 r34348  
    4949
    5050        // First, test Imagick's extension and classes.
    51         if ( ! extension_loaded( 'imagick' ) || ! class_exists( 'Imagick' ) || ! class_exists( 'ImagickPixel' ) )
     51        if ( ! extension_loaded( 'imagick' ) || ! class_exists( 'Imagick', false ) || ! class_exists( 'ImagickPixel', false ) )
    5252            return false;
    5353
  • trunk/src/wp-includes/functions.php

    r34265 r34348  
    36913691         * via ISAPI then pretty permalinks will not work.
    36923692         */
    3693         $supports_permalinks = class_exists('DOMDocument') && isset($_SERVER['IIS_UrlRewriteModule']) && ( PHP_SAPI == 'cgi-fcgi' );
     3693        $supports_permalinks = class_exists( 'DOMDocument', false ) && isset($_SERVER['IIS_UrlRewriteModule']) && ( PHP_SAPI == 'cgi-fcgi' );
    36943694    }
    36953695
  • trunk/src/wp-includes/general-template.php

    r34334 r34348  
    25812581 */
    25822582function wp_editor( $content, $editor_id, $settings = array() ) {
    2583     if ( ! class_exists( '_WP_Editors' ) )
     2583    if ( ! class_exists( '_WP_Editors', false ) )
    25842584        require( ABSPATH . WPINC . '/class-wp-editor.php' );
    25852585
  • trunk/src/wp-includes/pluggable-deprecated.php

    r33674 r34348  
    179179 * @link https://wordpress.org/plugins/atom-publishing-protocol/
    180180 */
    181 if ( ! class_exists( 'wp_atom_server' ) ) {
     181if ( ! class_exists( 'wp_atom_server', false ) ) {
    182182    class wp_atom_server {
    183183        public function __call( $name, $arguments ) {
  • trunk/src/wp-includes/pluggable.php

    r34244 r34348  
    23882388    $args = wp_parse_args( $args, $defaults );
    23892389
    2390     if ( !class_exists( 'WP_Text_Diff_Renderer_Table' ) )
     2390    if ( ! class_exists( 'WP_Text_Diff_Renderer_Table', false ) )
    23912391        require( ABSPATH . WPINC . '/wp-diff.php' );
    23922392
  • trunk/src/wp-includes/pomo/entry.php

    r32990 r34348  
    88 */
    99
    10 if ( !class_exists( 'Translation_Entry' ) ):
     10if ( ! class_exists( 'Translation_Entry', false ) ):
    1111/**
    1212 * Translation_Entry class encapsulates a translatable string
  • trunk/src/wp-includes/pomo/mo.php

    r32672 r34348  
    1111require_once dirname(__FILE__) . '/streams.php';
    1212
    13 if ( !class_exists( 'MO' ) ):
     13if ( ! class_exists( 'MO', false ) ):
    1414class MO extends Gettext_Translations {
    1515
  • trunk/src/wp-includes/pomo/po.php

    r32650 r34348  
    1717 * Routines for working with PO files
    1818 */
    19 if ( !class_exists( 'PO' ) ):
     19if ( ! class_exists( 'PO', false ) ):
    2020class PO extends Gettext_Translations {
    2121
     
    356356     * @staticvar string   $last_line
    357357     * @staticvar boolean  $use_last_line
    358      * 
     358     *
    359359     * @param     resource $f
    360360     * @param     string   $action
  • trunk/src/wp-includes/pomo/streams.php

    r32990 r34348  
    99 */
    1010
    11 if ( !class_exists( 'POMO_Reader' ) ):
     11if ( ! class_exists( 'POMO_Reader', false ) ):
    1212class POMO_Reader {
    1313
     
    135135endif;
    136136
    137 if ( !class_exists( 'POMO_FileReader' ) ):
     137if ( ! class_exists( 'POMO_FileReader', false ) ):
    138138class POMO_FileReader extends POMO_Reader {
    139139
     
    205205endif;
    206206
    207 if ( !class_exists( 'POMO_StringReader' ) ):
     207if ( ! class_exists( 'POMO_StringReader', false ) ):
    208208/**
    209209 * Provides file-like methods for manipulating a string instead
     
    268268endif;
    269269
    270 if ( !class_exists( 'POMO_CachedFileReader' ) ):
     270if ( ! class_exists( 'POMO_CachedFileReader', false ) ):
    271271/**
    272272 * Reads the contents of the file in the beginning.
     
    293293endif;
    294294
    295 if ( !class_exists( 'POMO_CachedIntFileReader' ) ):
     295if ( ! class_exists( 'POMO_CachedIntFileReader', false ) ):
    296296/**
    297297 * Reads the contents of the file in the beginning.
  • trunk/src/wp-includes/pomo/translations.php

    r32672 r34348  
    1010require_once dirname(__FILE__) . '/entry.php';
    1111
    12 if ( !class_exists( 'Translations' ) ):
     12if ( ! class_exists( 'Translations', false ) ):
    1313class Translations {
    1414    var $entries = array();
     
    273273endif;
    274274
    275 if ( !class_exists( 'NOOP_Translations' ) ):
     275if ( ! class_exists( 'NOOP_Translations', false ) ):
    276276/**
    277277 * Provides the same interface as Translations, but doesn't do anything
  • trunk/src/wp-includes/wp-db.php

    r34234 r34348  
    29942994    public function bail( $message, $error_code = '500' ) {
    29952995        if ( !$this->show_errors ) {
    2996             if ( class_exists( 'WP_Error' ) )
     2996            if ( class_exists( 'WP_Error', false ) ) {
    29972997                $this->error = new WP_Error($error_code, $message);
    2998             else
     2998            } else {
    29992999                $this->error = $message;
     3000            }
    30003001            return false;
    30013002        }
  • trunk/src/wp-includes/wp-diff.php

    r31295 r34348  
    99 */
    1010
    11 if ( !class_exists( 'Text_Diff' ) ) {
     11if ( ! class_exists( 'Text_Diff', false ) ) {
    1212    /** Text_Diff class */
    1313    require( dirname(__FILE__).'/Text/Diff.php' );
Note: See TracChangeset for help on using the changeset viewer.