4 * Disable error reporting
6 * Set this to error_reporting( E_ALL ) or error_reporting( E_ALL | E_STRICT ) for debugging
10 /** Set ABSPATH for execution */
11 define( 'ABSPATH', dirname(dirname(__FILE__)) . '/' );
12 define( 'WPINC', 'wp-includes' );
28 function add_filter() {}
33 function esc_attr() {}
38 function apply_filters() {}
43 function get_option() {}
48 function is_lighttpd_before_150() {}
53 function add_action() {}
58 function do_action_ref_array() {}
63 function get_bloginfo() {}
68 function is_admin() {return true;}
73 function site_url() {}
78 function admin_url() {}
83 function home_url() {}
88 function includes_url() {}
93 function wp_guess_url() {}
95 if ( ! function_exists( 'json_encode' ) ) :
99 function json_encode() {}
102 function get_file($path) {
104 if ( function_exists('realpath') )
105 $path = realpath($path);
107 if ( ! $path || ! @is_file($path) )
110 return @file_get_contents($path);
113 $load = preg_replace( '/[^a-z0-9,_-]+/i', '', $_GET['load'] );
114 $load = explode(',', $load);
119 require(ABSPATH . WPINC . '/script-loader.php');
120 require(ABSPATH . WPINC . '/version.php');
122 $compress = ( isset($_GET['c']) && $_GET['c'] );
123 $force_gzip = ( $compress && 'gzip' == $_GET['c'] );
124 $expires_offset = 31536000;
127 $wp_scripts = new WP_Scripts();
128 wp_default_scripts($wp_scripts);
130 foreach( $load as $handle ) {
131 if ( !array_key_exists($handle, $wp_scripts->registered) )
134 $path = ABSPATH . $wp_scripts->registered[$handle]->src;
135 $out .= get_file($path) . "\n";
138 header('Content-Type: application/x-javascript; charset=UTF-8');
139 header('Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT');
140 header("Cache-Control: public, max-age=$expires_offset");
142 if ( $compress && ! ini_get('zlib.output_compression') && 'ob_gzhandler' != ini_get('output_handler') && isset($_SERVER['HTTP_ACCEPT_ENCODING']) ) {
143 header('Vary: Accept-Encoding'); // Handle proxies
144 if ( false !== stripos($_SERVER['HTTP_ACCEPT_ENCODING'], 'deflate') && function_exists('gzdeflate') && ! $force_gzip ) {
145 header('Content-Encoding: deflate');
146 $out = gzdeflate( $out, 3 );
147 } elseif ( false !== stripos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') && function_exists('gzencode') ) {
148 header('Content-Encoding: gzip');
149 $out = gzencode( $out, 3 );