7 */ |
7 */ |
8 error_reporting( 0 ); |
8 error_reporting( 0 ); |
9 |
9 |
10 /** Set ABSPATH for execution */ |
10 /** Set ABSPATH for execution */ |
11 if ( ! defined( 'ABSPATH' ) ) { |
11 if ( ! defined( 'ABSPATH' ) ) { |
12 define( 'ABSPATH', dirname( dirname( __FILE__ ) ) . '/' ); |
12 define( 'ABSPATH', dirname( __DIR__ ) . '/' ); |
13 } |
13 } |
14 |
14 |
15 define( 'WPINC', 'wp-includes' ); |
15 define( 'WPINC', 'wp-includes' ); |
16 |
16 |
17 require( ABSPATH . 'wp-admin/includes/noop.php' ); |
17 require ABSPATH . 'wp-admin/includes/noop.php'; |
18 require( ABSPATH . WPINC . '/script-loader.php' ); |
18 require ABSPATH . WPINC . '/script-loader.php'; |
19 require( ABSPATH . WPINC . '/version.php' ); |
19 require ABSPATH . WPINC . '/version.php'; |
|
20 |
|
21 $protocol = $_SERVER['SERVER_PROTOCOL']; |
|
22 if ( ! in_array( $protocol, array( 'HTTP/1.1', 'HTTP/2', 'HTTP/2.0' ), true ) ) { |
|
23 $protocol = 'HTTP/1.0'; |
|
24 } |
20 |
25 |
21 $load = $_GET['load']; |
26 $load = $_GET['load']; |
22 if ( is_array( $load ) ) { |
27 if ( is_array( $load ) ) { |
|
28 ksort( $load ); |
23 $load = implode( '', $load ); |
29 $load = implode( '', $load ); |
24 } |
30 } |
|
31 |
25 $load = preg_replace( '/[^a-z0-9,_-]+/i', '', $load ); |
32 $load = preg_replace( '/[^a-z0-9,_-]+/i', '', $load ); |
26 $load = array_unique( explode( ',', $load ) ); |
33 $load = array_unique( explode( ',', $load ) ); |
27 |
34 |
28 if ( empty( $load ) ) { |
35 if ( empty( $load ) ) { |
|
36 header( "$protocol 400 Bad Request" ); |
29 exit; |
37 exit; |
30 } |
38 } |
31 |
39 |
32 $rtl = ( isset( $_GET['dir'] ) && 'rtl' == $_GET['dir'] ); |
40 $rtl = ( isset( $_GET['dir'] ) && 'rtl' === $_GET['dir'] ); |
33 $expires_offset = 31536000; // 1 year |
41 $expires_offset = 31536000; // 1 year. |
34 $out = ''; |
42 $out = ''; |
35 |
43 |
36 $wp_styles = new WP_Styles(); |
44 $wp_styles = new WP_Styles(); |
37 wp_default_styles( $wp_styles ); |
45 wp_default_styles( $wp_styles ); |
38 |
46 |
39 if ( isset( $_SERVER['HTTP_IF_NONE_MATCH'] ) && stripslashes( $_SERVER['HTTP_IF_NONE_MATCH'] ) === $wp_version ) { |
47 if ( isset( $_SERVER['HTTP_IF_NONE_MATCH'] ) && stripslashes( $_SERVER['HTTP_IF_NONE_MATCH'] ) === $wp_version ) { |
40 $protocol = $_SERVER['SERVER_PROTOCOL']; |
|
41 if ( ! in_array( $protocol, array( 'HTTP/1.1', 'HTTP/2', 'HTTP/2.0' ) ) ) { |
|
42 $protocol = 'HTTP/1.0'; |
|
43 } |
|
44 header( "$protocol 304 Not Modified" ); |
48 header( "$protocol 304 Not Modified" ); |
45 exit(); |
49 exit; |
46 } |
50 } |
47 |
51 |
48 foreach ( $load as $handle ) { |
52 foreach ( $load as $handle ) { |
49 if ( ! array_key_exists( $handle, $wp_styles->registered ) ) { |
53 if ( ! array_key_exists( $handle, $wp_styles->registered ) ) { |
50 continue; |
54 continue; |