@@ 66-77 (lines=12) @@ | ||
63 | $jetpack_asset_hashes = self::get_plugin_checksums( $jetpack_version, 'jetpack' ); |
|
64 | $jetpack_directory_url = plugins_url( '/', JETPACK__PLUGIN_FILE ); |
|
65 | ||
66 | foreach ( $wp_scripts->registered as $handle => $thing ) { |
|
67 | if ( wp_startswith( $thing->src, 'https://c0.wp.com/' ) ) { |
|
68 | continue; |
|
69 | } |
|
70 | if ( wp_startswith( $thing->src, $jetpack_directory_url ) ) { |
|
71 | $local_path = substr( $thing->src, strlen( $jetpack_directory_url ) ); |
|
72 | if ( isset( $jetpack_asset_hashes[ $local_path ] ) ) { |
|
73 | $wp_scripts->registered[ $handle ]->src = sprintf('https://c0.wp.com/p/jetpack/%1$s/%2$s', $jetpack_version, $local_path ); |
|
74 | wp_script_add_data( $handle, 'integrity', 'sha256-' . base64_encode( $jetpack_asset_hashes[ $local_path ] ) ); |
|
75 | } |
|
76 | } |
|
77 | } |
|
78 | foreach ( $wp_styles->registered as $handle => $thing ) { |
|
79 | if ( wp_startswith( $thing->src, 'https://c0.wp.com/' ) ) { |
|
80 | continue; |
|
@@ 78-89 (lines=12) @@ | ||
75 | } |
|
76 | } |
|
77 | } |
|
78 | foreach ( $wp_styles->registered as $handle => $thing ) { |
|
79 | if ( wp_startswith( $thing->src, 'https://c0.wp.com/' ) ) { |
|
80 | continue; |
|
81 | } |
|
82 | if ( wp_startswith( $thing->src, $jetpack_directory_url ) ) { |
|
83 | $local_path = substr( $thing->src, strlen( $jetpack_directory_url ) ); |
|
84 | if ( isset( $jetpack_asset_hashes[ $local_path ] ) ) { |
|
85 | $wp_styles->registered[ $handle ]->src = sprintf('https://c0.wp.com/p/jetpack/%1$s/%2$s', $jetpack_version, $local_path ); |
|
86 | wp_style_add_data( $handle, 'integrity', 'sha256-' . base64_encode( $jetpack_asset_hashes[ $local_path ] ) ); |
|
87 | } |
|
88 | } |
|
89 | } |
|
90 | } |
|
91 | } |
|
92 |