- Timestamp:
- 02/07/2024 07:00:03 AM (22 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/trac.wordpress.org/templates/update-headers.php
r13185 r13186 89 89 */ 90 90 $html = preg_replace_callback( 91 '!(?P<url>https: //wordpress.org/wp-(includes|content)/[^\'"]+)!i',91 '!(?P<url>https:[\\\/]+wordpress.org[\\\/]+wp-(includes|content)[\\\/]+[^\'"]+)!i', 92 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 ) ) { 93 $url = $m['url']; 94 $escaped = false !== strpos( $url, '\/' ); 95 96 if ( $escaped ) { 97 $url = stripslashes( $url ); 98 } 99 100 $url = str_replace( 'wordpress.org', 's.w.org', $url ); 101 $hash = md5( file_get_contents( $url ) ); 102 103 if ( preg_match( '/([?&;](ver|v)=[^&]+)/i', $url, $m ) ) { 97 104 $url = str_replace( $m[0], $m[0] . '-' . $hash, $url ); 98 105 } else { 99 $url .= ( str_contains( $url, '?' ) ? '&' : '?' ) . 'ver=' . $hash; 106 $url .= ( strpos( $url, '?' ) ? '&' : '?' ) . 'ver=' . $hash; 107 } 108 109 if ( $escaped ) { 110 $url = addcslashes( $url, '/' ); 100 111 } 101 112
Note: See TracChangeset
for help on using the changeset viewer.