Changeset 59712
- Timestamp:
- 01/27/2025 02:39:18 PM (34 hours ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/admin-filters.php
r59260 r59712 45 45 // Misc hooks. 46 46 add_action( 'admin_init', 'wp_admin_headers' ); 47 add_action( 'login_init', 'wp_admin_headers' );48 47 add_action( 'admin_init', 'send_frame_options_header', 10, 0 ); 49 48 add_action( 'admin_head', 'wp_admin_canonical_url' ); -
trunk/src/wp-admin/includes/misc.php
r58975 r59712 1417 1417 1418 1418 /** 1419 * Sends a referrer policy header so referrers are not sent externally from administration screens.1420 *1421 * @since 4.9.01422 */1423 function wp_admin_headers() {1424 $policy = 'strict-origin-when-cross-origin';1425 1426 /**1427 * Filters the admin referrer policy header value.1428 *1429 * @since 4.9.01430 * @since 4.9.5 The default value was changed to 'strict-origin-when-cross-origin'.1431 *1432 * @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy1433 *1434 * @param string $policy The admin referrer policy header value. Default 'strict-origin-when-cross-origin'.1435 */1436 $policy = apply_filters( 'admin_referrer_policy', $policy );1437 1438 header( sprintf( 'Referrer-Policy: %s', $policy ) );1439 }1440 1441 /**1442 1419 * Outputs JS that reloads the page if the user navigated to it with the Back or Forward button. 1443 1420 * -
trunk/src/wp-includes/default-filters.php
r59688 r59712 390 390 add_action( 'login_footer', 'wp_print_footer_scripts', 20 ); 391 391 add_action( 'login_init', 'send_frame_options_header', 10, 0 ); 392 add_action( 'login_init', 'wp_admin_headers' ); 392 393 393 394 // Feed generator tags. -
trunk/src/wp-includes/functions.php
r59688 r59712 7146 7146 7147 7147 /** 7148 * Sends a referrer policy header so referrers are not sent externally from administration screens. 7149 * 7150 * @since 4.9.0 7151 * @since 6.8.0 This function was moved from `wp-admin/includes/misc.php` to `wp-includes/functions.php`. 7152 */ 7153 function wp_admin_headers() { 7154 $policy = 'strict-origin-when-cross-origin'; 7155 7156 /** 7157 * Filters the admin referrer policy header value. 7158 * 7159 * @since 4.9.0 7160 * @since 4.9.5 The default value was changed to 'strict-origin-when-cross-origin'. 7161 * 7162 * @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy 7163 * 7164 * @param string $policy The admin referrer policy header value. Default 'strict-origin-when-cross-origin'. 7165 */ 7166 $policy = apply_filters( 'admin_referrer_policy', $policy ); 7167 7168 header( sprintf( 'Referrer-Policy: %s', $policy ) ); 7169 } 7170 7171 /** 7148 7172 * Retrieves a list of protocols to allow in HTML attributes. 7149 7173 *
Note: See TracChangeset
for help on using the changeset viewer.