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' );
27 function add_filter() {}
32 function esc_attr() {}
37 function apply_filters() {}
42 function get_option() {}
47 function is_lighttpd_before_150() {}
52 function add_action() {}
57 function do_action_ref_array() {}
62 function get_bloginfo() {}
67 function is_admin() {return true;}
72 function site_url() {}
77 function admin_url() {}
82 function wp_guess_url() {}
84 function get_file($path) {
86 if ( function_exists('realpath') )
87 $path = realpath($path);
89 if ( ! $path || ! @is_file($path) )
92 return @file_get_contents($path);
95 require(ABSPATH . '/wp-includes/script-loader.php');
96 require(ABSPATH . '/wp-includes/version.php');
98 $load = preg_replace( '/[^a-z0-9,_-]+/i', '', $_GET['load'] );
99 $load = array_unique( explode( ',', $load ) );
104 $compress = ( isset($_GET['c']) && $_GET['c'] );
105 $force_gzip = ( $compress && 'gzip' == $_GET['c'] );
106 $rtl = ( isset($_GET['dir']) && 'rtl' == $_GET['dir'] );
107 $expires_offset = 31536000; // 1 year
110 $wp_styles = new WP_Styles();
111 wp_default_styles($wp_styles);
113 foreach( $load as $handle ) {
114 if ( !array_key_exists($handle, $wp_styles->registered) )
117 $style = $wp_styles->registered[$handle];
118 $path = ABSPATH . $style->src;
120 if ( $rtl && ! empty( $style->extra['rtl'] ) ) {
121 // All default styles have fully independent RTL files.
122 $path = str_replace( '.min.css', '-rtl.min.css', $path );
125 $content = get_file( $path ) . "\n";
127 if ( strpos( $style->src, '/wp-includes/css/' ) === 0 ) {
128 $content = str_replace( '../images/', '../wp-includes/images/', $content );
129 $content = str_replace( '../js/tinymce/', '../wp-includes/js/tinymce/', $content );
130 $content = str_replace( '../fonts/', '../wp-includes/fonts/', $content );
133 $out .= str_replace( '../images/', 'images/', $content );
137 header('Content-Type: text/css; charset=UTF-8');
138 header('Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT');
139 header("Cache-Control: public, max-age=$expires_offset");
141 if ( $compress && ! ini_get('zlib.output_compression') && 'ob_gzhandler' != ini_get('output_handler') && isset($_SERVER['HTTP_ACCEPT_ENCODING']) ) {
142 header('Vary: Accept-Encoding'); // Handle proxies
143 if ( false !== stripos($_SERVER['HTTP_ACCEPT_ENCODING'], 'deflate') && function_exists('gzdeflate') && ! $force_gzip ) {
144 header('Content-Encoding: deflate');
145 $out = gzdeflate( $out, 3 );
146 } elseif ( false !== stripos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') && function_exists('gzencode') ) {
147 header('Content-Encoding: gzip');
148 $out = gzencode( $out, 3 );