- Timestamp:
- 02/07/2024 06:09:45 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/trac.wordpress.org/templates/update-headers.php
r13182 r13183 80 80 81 81 return $prefix_id . $m['suffix']; 82 }, 83 $html 84 ); 85 86 /* 87 * Use CDN assets, to avoid CORS issues. 88 * Until https://github.com/WordPress/wporg-mu-plugins/pull/430 is resolved. 89 */ 90 $html = preg_replace_callback( 91 '!(?P<url>https://wordpress.org/wp-(includes|content)/[^\'"]+)!i', 92 function( $m ) { 93 $url = str_replace( 'https://wordpress.org/', 'https://s.w.org/', $m['url'] ); 94 $hash = md5( file_get_contents( $m['url'] ) ); 95 96 if ( preg_match( '/([?&](ver)=[^&]+)/i', $url, $m ) ) { 97 $url = str_replace( $m[0], $m[0] . '-' . $hash, $url ); 98 } else { 99 $url .= ( str_contains( $url, '?' ) ? '&' : '?' ) . 'ver=' . $hash; 100 } 101 102 return $url; 82 103 }, 83 104 $html
Note: See TracChangeset
for help on using the changeset viewer.