Make WordPress Core

Ticket #25161: 25161.patch

File 25161.patch, 2.0 KB (added by azaozz, 12 years ago)
  • Gruntfile.js

     
    1717                },
    1818                copy: {
    1919                        all: {
     20                                options: {
     21                                        processContent: function( src, filepath ) {
     22                                                if ( filepath.indexOf( 'wp-settings.php' ) > -1 ) {
     23                                                        src = src.replace( /\/\/ Removed when building the release\s+/, '' )
     24                                                                .replace( /if \( ! defined\( 'SCRIPT_DEBUG' \) \)\s+/, '' )
     25                                                                .replace( /define\( 'SCRIPT_DEBUG', true \);\s+/, '' );
     26                                                       
     27                                                        if ( src.indexOf( 'SCRIPT_DEBUG' ) > -1 ) {
     28                                                                grunt.fail.fatal('Failed to remove SCRIPT_DEBUG from wp-settings.php');;
     29                                                        }
     30                                                }
     31
     32                                                return src;
     33                                        },
     34                                        processContentExclude: SOURCE_DIR + '*/**' // Don't process files in sub-directories
     35                                },
    2036                                dot: true,
    2137                                expand: true,
    2238                                cwd: SOURCE_DIR,
  • src/wp-includes/script-loader.php

     
    5757        $scripts->default_version = get_bloginfo( 'version' );
    5858        $scripts->default_dirs = array('/wp-admin/js/', '/wp-includes/js/');
    5959
    60         if ( ! defined( 'SCRIPT_DEBUG' ) )
    61                 define( 'SCRIPT_DEBUG', ! file_exists( ABSPATH . WPINC . '/js/wp-util.min.js' ) );
     60        $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
    6261
    63         $suffix = SCRIPT_DEBUG ? '' : '.min';
    64 
    6562        $scripts->add( 'utils', "/wp-includes/js/utils$suffix.js" );
    6663        did_action( 'init' ) && $scripts->localize( 'utils', 'userSettings', array(
    6764                'url' => (string) SITECOOKIEPATH,
  • src/wp-settings.php

     
    1515 *
    1616 * @since 1.0.0
    1717 */
     18
     19// Removed when building the release
     20if ( ! defined( 'SCRIPT_DEBUG' ) )
     21        define( 'SCRIPT_DEBUG', true );
     22
    1823define( 'WPINC', 'wp-includes' );
    1924
    2025// Include files required for initialization.