Changeset 15149
- Timestamp:
- 09/04/2026 08:28:19 PM (2 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/api.wordpress.org/public_html/dotorg/trac/oembed/index.php
r15098 r15149 150 150 header( 'X-Content-Type-Options: nosniff' ); 151 151 152 /* 153 * The iframe's sandbox covers that element, not this response, which is reachable directly. 154 * Re-serving third-party markup is the point of this endpoint, so the sandbox is the boundary 155 * rather than the markup: the document cannot act as this origin, and it shows nothing the Trac 156 * URL it mirrors does not already show to the same audience. 157 */ 158 header( 'Content-Security-Policy: sandbox allow-scripts allow-top-navigation-by-user-activation' ); 159 152 160 $cache_key = sha1( $url ); 153 161 if ( $data = wp_cache_get( $cache_key, 'trac-oembed' ) ) { … … 309 317 $js = <<<JS 310 318 (function() { 319 if ( window.parent === window ) { 320 return; 321 } 322 311 323 var id = ( document.location.hash.match(/el=([0-9a-f]+)(&|$)/) || [ '', '' ] )[1]; 312 324 … … 324 336 })(); 325 337 JS; 326 $doc->getElementsByTagName( 'head' )[0]->appendChild( $doc->createElement( 'script', $js ) ); 338 339 $reporter = $doc->createElement( 'script' ); 340 $reporter->appendChild( $doc->createTextNode( $js ) ); 341 $doc->getElementsByTagName( 'head' )[0]->appendChild( $reporter ); 327 342 328 343 $css = <<<CSS
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)