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 wp_guess_url() {}
85 function get_file($path) {
87 if ( function_exists('realpath') )
88 $path = realpath($path);
90 if ( ! $path || ! @is_file($path) )
93 return @file_get_contents($path);
96 require(ABSPATH . '/wp-includes/script-loader.php');
97 require(ABSPATH . '/wp-includes/version.php');
99 $load = preg_replace( '/[^a-z0-9,_-]+/i', '', $_GET['load'] );
100 $load = explode(',', $load);
105 $compress = ( isset($_GET['c']) && $_GET['c'] );
106 $force_gzip = ( $compress && 'gzip' == $_GET['c'] );
107 $rtl = ( isset($_GET['dir']) && 'rtl' == $_GET['dir'] );
108 $expires_offset = 31536000;
111 $wp_styles = new WP_Styles();
112 wp_default_styles($wp_styles);
114 foreach( $load as $handle ) {
115 if ( !array_key_exists($handle, $wp_styles->registered) )
118 $style = $wp_styles->registered[$handle];
119 $path = ABSPATH . $style->src;
121 $content = get_file($path) . "\n";
123 if ( $rtl && isset($style->extra['rtl']) && $style->extra['rtl'] ) {
124 $rtl_path = is_bool($style->extra['rtl']) ? str_replace( '.css', '-rtl.css', $path ) : ABSPATH . $style->extra['rtl'];
125 $content .= get_file($rtl_path) . "\n";
128 if ( strpos( $style->src, '/wp-includes/css/' ) === 0 ) {
129 $content = str_replace( '../images/', '../wp-includes/images/', $content );
130 $out .= str_replace( '../js/tinymce/', '../wp-includes/js/tinymce/', $content );
132 $out .= str_replace( '../images/', 'images/', $content );
136 header('Content-Type: text/css');
137 header('Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT');
138 header("Cache-Control: public, max-age=$expires_offset");
140 if ( $compress && ! ini_get('zlib.output_compression') && 'ob_gzhandler' != ini_get('output_handler') && isset($_SERVER['HTTP_ACCEPT_ENCODING']) ) {
141 header('Vary: Accept-Encoding'); // Handle proxies
142 if ( false !== stripos($_SERVER['HTTP_ACCEPT_ENCODING'], 'deflate') && function_exists('gzdeflate') && ! $force_gzip ) {
143 header('Content-Encoding: deflate');
144 $out = gzdeflate( $out, 3 );
145 } elseif ( false !== stripos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') && function_exists('gzencode') ) {
146 header('Content-Encoding: gzip');
147 $out = gzencode( $out, 3 );