Submit
Path:
~
/
home
/
bfxleof
/
www
/
wp-includes
/
js
/
File Content:
https-migration.php
<?php /** * HTTPS migration functions. * * @package WordPress * @since 5.7.0 */ /** * Checks whether WordPress should replace old HTTP URLs to the site with their HTTPS counterpart. * * If a WordPress site had its URL changed from HTTP to HTTPS, by default this will return `true`, causing WordPress to * add frontend filters to replace insecure site URLs that may be present in older database content. The * {@see 'wp_should_replace_insecure_home_url'} filter can be used to modify that behavior. * * @since 5.7.0 * * @return bool True if insecure URLs should replaced, false otherwise. */ function wp_should_replace_insecure_home_url() { $should_replace_insecure_home_url = wp_is_using_https() && get_option( 'https_migration_required' ) // For automatic replacement, both 'home' and 'siteurl' need to not only use HTTPS, they also need to be using // the same domain. && wp_parse_url( home_url(), PHP_URL_HOST ) === wp_parse_url( site_url(), PHP_URL_HOST ); /** * Filters whether WordPress should replace old HTTP URLs to the site with their HTTPS counterpart. * * If a WordPress site had its URL changed from HTTP to HTTPS, by default this will return `true`. This filter can * be used to disable that behavior, e.g. after having replaced URLs manually in the database. * * @since 5.7.0 * * @param bool $should_replace_insecure_home_url Whether insecure HTTP URLs to the site should be replaced. */ return apply_filters( 'wp_should_replace_insecure_home_url', $should_replace_insecure_home_url ); } /** * Replaces insecure HTTP URLs to the site in the given content, if configured to do so. * * This function replaces all occurrences of the HTTP version of the site's URL with its HTTPS counterpart, if * determined via {@see wp_should_replace_insecure_home_url()}. * * @since 5.7.0 * * @param string $content Content to replace URLs in. * @return string Filtered content. */ function wp_replace_insecure_home_url( $content ) { if ( ! wp_should_replace_insecure_home_url() ) { return $content; } $https_url = home_url( '', 'https' ); $http_url = str_replace( 'https://', 'http://', $https_url ); // Also replace potentially escaped URL. $escaped_https_url = str_replace( '/', '\/', $https_url ); $escaped_http_url = str_replace( '/', '\/', $http_url ); return str_replace( array( $http_url, $escaped_http_url, ), array( $https_url, $escaped_https_url, ), $content ); } /** * Update the 'home' and 'siteurl' option to use the HTTPS variant of their URL. * * If this update does not result in WordPress recognizing that the site is now using HTTPS (e.g. due to constants * overriding the URLs used), the changes will be reverted. In such a case the function will return false. * * @since 5.7.0 * * @return bool True on success, false on failure. */ function wp_update_urls_to_https() { // Get current URL options. $orig_home = get_option( 'home' ); $orig_siteurl = get_option( 'siteurl' ); // Get current URL options, replacing HTTP with HTTPS. $home = str_replace( 'http://', 'https://', $orig_home ); $siteurl = str_replace( 'http://', 'https://', $orig_siteurl ); // Update the options. update_option( 'home', $home ); update_option( 'siteurl', $siteurl ); if ( ! wp_is_using_https() ) { // If this did not result in the site recognizing HTTPS as being used, // revert the change and return false. update_option( 'home', $orig_home ); update_option( 'siteurl', $orig_siteurl ); return false; } // Otherwise the URLs were successfully changed to use HTTPS. return true; } /** * Updates the 'https_migration_required' option if needed when the given URL has been updated from HTTP to HTTPS. * * If this is a fresh site, a migration will not be required, so the option will be set as `false`. * * This is hooked into the {@see 'update_option_home'} action. * * @since 5.7.0 * @access private * * @param mixed $old_url Previous value of the URL option. * @param mixed $new_url New value of the URL option. */ function wp_update_https_migration_required( $old_url, $new_url ) { // Do nothing if WordPress is being installed. if ( wp_installing() ) { return; } // Delete/reset the option if the new URL is not the HTTPS version of the old URL. if ( untrailingslashit( (string) $old_url ) !== str_replace( 'https://', 'http://', untrailingslashit( (string) $new_url ) ) ) { delete_option( 'https_migration_required' ); return; } // If this is a fresh site, there is no content to migrate, so do not require migration. $https_migration_required = get_option( 'fresh_site' ) ? false : true; update_option( 'https_migration_required', $https_migration_required ); }
Submit
FILE
FOLDER
Name
Size
Permission
Action
codemirror
---
0755
crop
---
0755
dist
---
0755
imgareaselect
---
0755
jcrop
---
0755
jquery
---
0755
mediaelement
---
0755
plupload
---
0755
swfupload
---
0755
thickbox
---
0755
tinymce
---
0755
admin-bar.js
10762 bytes
0644
admin-bar.min.js
3556 bytes
0644
autosave.js
22518 bytes
0644
autosave.min.js
5847 bytes
0644
backbone.js
77794 bytes
0604
backbone.min.js
23818 bytes
0644
class-wp-theme.php
51601 bytes
0644
clipboard.js
29493 bytes
0644
clipboard.min.js
10419 bytes
0644
colorpicker.js
29083 bytes
0604
colorpicker.min.js
16562 bytes
0644
comment-reply.js
12457 bytes
0644
comment-reply.min.js
2984 bytes
0644
customize-base.js
25766 bytes
0644
customize-base.min.js
7858 bytes
0644
customize-loader.js
7904 bytes
0644
customize-loader.min.js
3553 bytes
0644
customize-models.js
6821 bytes
0644
customize-models.min.js
3693 bytes
0644
customize-preview-nav-menus.js
15024 bytes
0644
customize-preview-nav-menus.min.js
5038 bytes
0644
customize-preview-widgets.js
23253 bytes
0644
customize-preview-widgets.min.js
7824 bytes
0644
customize-preview.js
27960 bytes
0644
customize-preview.min.js
10758 bytes
0644
customize-selective-refresh.js
33332 bytes
0644
customize-selective-refresh.min.js
10693 bytes
0644
customize-views.js
5065 bytes
0604
customize-views.min.js
2451 bytes
0644
heartbeat.js
23154 bytes
0644
heartbeat.min.js
5883 bytes
0644
hoverintent-js.min.js
1718 bytes
0604
https-detection-20260622230655.php
6871 bytes
0644
https-detection.php
6871 bytes
0644
https-migration-20260621215951.php
4730 bytes
0644
https-migration-20260621222700-20260622150413.php
4730 bytes
0644
https-migration-20260621222700.php
4730 bytes
0644
https-migration-20260622015718.php
4730 bytes
0644
https-migration-20260622145328.php
4730 bytes
0644
https-migration-20260622165410.php
4730 bytes
0644
https-migration-20260622204948.php
4730 bytes
0644
https-migration-20260622211332.php
4730 bytes
0644
https-migration-20260622230538.php
4730 bytes
0644
https-migration.php
4730 bytes
0644
imagesloaded.min.js
5629 bytes
0644
json2.js
18422 bytes
0604
json2.min.js
3153 bytes
0644
masonry.min.js
24138 bytes
0644
mce-view.js
26059 bytes
0644
mce-view.min.js
9883 bytes
0644
media-audiovideo.js
27553 bytes
0644
media-audiovideo.min.js
12921 bytes
0644
media-editor.js
29119 bytes
0644
media-editor.min.js
10909 bytes
0644
media-grid.js
29532 bytes
0644
media-grid.min.js
14165 bytes
0644
media-models.js
45137 bytes
0644
media-models.min.js
13811 bytes
0644
media-views.js
267734 bytes
0644
media-views.min.js
107493 bytes
0644
quicktags.js
22615 bytes
0604
quicktags.min.js
11149 bytes
0644
swfobject.js
10231 bytes
0604
tw-sack.js
4969 bytes
0604
tw-sack.min.js
3299 bytes
0604
twemoji.js
28010 bytes
0644
twemoji.min.js
11307 bytes
0644
underscore.min.js
16045 bytes
0644
utils.js
4665 bytes
0604
utils.min.js
1864 bytes
0644
wp-ajax-response.js
3214 bytes
0644
wp-ajax-response.min.js
2098 bytes
0644
wp-api.js
46983 bytes
0644
wp-api.min.js
14687 bytes
0644
wp-auth-check.js
4225 bytes
0644
wp-auth-check.min.js
1674 bytes
0644
wp-backbone.js
15240 bytes
0644
wp-backbone.min.js
3037 bytes
0644
wp-custom-header.js
10447 bytes
0644
wp-custom-header.min.js
4442 bytes
0644
wp-embed-template.js
6392 bytes
0644
wp-embed-template.min.js
3154 bytes
0644
wp-embed.js
3414 bytes
0644
wp-embed.min.js
1478 bytes
0644
wp-emoji-loader.js
6953 bytes
0644
wp-emoji-loader.min.js
1852 bytes
0644
wp-emoji-release.min.js
14229 bytes
0644
wp-emoji.js
8989 bytes
0604
wp-emoji.min.js
2873 bytes
0644
wp-list-revisions.js
970 bytes
0604
wp-list-revisions.min.js
597 bytes
0644
wp-lists.js
25315 bytes
0644
wp-lists.min.js
7434 bytes
0644
wp-sanitize.js
1350 bytes
0604
wp-sanitize.min.js
458 bytes
0644
wp-util.js
4113 bytes
0644
wp-util.min.js
1169 bytes
0644
wpdialog.js
560 bytes
0604
wpdialog.min.js
272 bytes
0604
wplink.js
21160 bytes
0644
wplink.min.js
11283 bytes
0644
zxcvbn-async.js
821 bytes
0604
zxcvbn-async.min.js
351 bytes
0644
zxcvbn.min.js
822237 bytes
0604
N4ST4R_ID | Naxtarrr