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' );
33
function add_filter() {}
38
function esc_attr() {}
43
function apply_filters() {}
48
function get_option() {}
53
function is_lighttpd_before_150() {}
58
function add_action() {}
63
function do_action_ref_array() {}
68
function get_bloginfo() {}
73
function is_admin() {return true;}
78
function site_url() {}
83
function admin_url() {}
88
function wp_guess_url() {}
90
function get_file($path) {
92
if ( function_exists('realpath') )
93
$path = realpath($path);
95
if ( ! $path || ! @is_file($path) )
98
return @file_get_contents($path);
101
require(ABSPATH . '/wp-includes/script-loader.php');
102
require(ABSPATH . '/wp-includes/version.php');
104
$load = preg_replace( '/[^a-z0-9,_-]+/i', '', $_GET['load'] );
105
$load = explode(',', $load);
110
$compress = ( isset($_GET['c']) && $_GET['c'] );
111
$force_gzip = ( $compress && 'gzip' == $_GET['c'] );
112
$rtl = ( isset($_GET['dir']) && 'rtl' == $_GET['dir'] );
113
$expires_offset = 31536000;
116
$wp_styles = new WP_Styles();
117
wp_default_styles($wp_styles);
119
foreach( $load as $handle ) {
120
if ( !array_key_exists($handle, $wp_styles->registered) )
123
$style = $wp_styles->registered[$handle];
124
$path = ABSPATH . $style->src;
126
$content = get_file($path) . "\n";
128
if ( $rtl && isset($style->extra['rtl']) && $style->extra['rtl'] ) {
129
$rtl_path = is_bool($style->extra['rtl']) ? str_replace( '.css', '-rtl.css', $path ) : ABSPATH . $style->extra['rtl'];
130
$content .= get_file($rtl_path) . "\n";
133
$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') ) {
141
header('Vary: Accept-Encoding'); // Handle proxies
142
if ( false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'deflate') && function_exists('gzdeflate') && ! $force_gzip ) {
143
header('Content-Encoding: deflate');
144
$out = gzdeflate( $out, 3 );
145
} elseif ( false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip') && function_exists('gzencode') ) {
146
header('Content-Encoding: gzip');
147
$out = gzencode( $out, 3 );