/var/www/p4ela.net/www/wp-includes
NameSizeModeActions
assets/-0777rm
block-bindings/-0777rm
block-patterns/-0777rm
block-supports/-0777rm
blocks/-0777rm
certificates/-0777rm
css/-0777rm
customize/-0777rm
fonts/-0777rm
html-api/-0777rm
ID3/-0777rm
images/-0777rm
interactivity-api/-0777rm
IXR/-0777rm
js/-0777rm
l10n/-0777rm
php-compat/-0777rm
PHPMailer/-0777rm
pomo/-0777rm
Requests/-0777rm
rest-api/-0777rm
SimplePie/-0777rm
sitemaps/-0777rm
sodium_compat/-0777rm
style-engine/-0777rm
Text/-0777rm
theme-compat/-0777rm
widgets/-0777rm
admin-bar.php371000666editdlrm
atomlib.php120780666editdlrm
author-template.php189510666editdlrm
block-bindings.php55940666editdlrm
block-editor.php283400666editdlrm
block-i18n.json3160666editdlrm
block-patterns.php131190666editdlrm
block-template-utils.php601450666editdlrm
block-template.php141420666editdlrm
blocks.php1048890666editdlrm
bookmark-template.php129480666editdlrm
bookmark.php154270666editdlrm
cache-compat.php59690666editdlrm
cache.php134740666editdlrm
canonical.php345060666editdlrm
capabilities.php427180666editdlrm
category-template.php570030666editdlrm
category.php127090666editdlrm
class-avif-info.php296150666editdlrm
class-feed.php5390666editdlrm
class-http.php3670666editdlrm
class-IXR.php25430666editdlrm
class-json.php436840666editdlrm
class-oembed.php4010666editdlrm
class-phpass.php67710666editdlrm
class-phpmailer.php6640666editdlrm
class-pop3.php211740666editdlrm
class-requests.php22370666editdlrm
class-simplepie.php4530666editdlrm
class-smtp.php4570666editdlrm
class-snoopy.php377150666editdlrm
class-walker-category-dropdown.php24690666editdlrm
class-walker-category.php84770666editdlrm
class-walker-comment.php142210666editdlrm
class-walker-nav-menu.php117840666editdlrm
class-walker-page-dropdown.php27100666editdlrm
class-walker-page.php76120666editdlrm
class-wp-admin-bar.php178740666editdlrm
class-wp-ajax-response.php52660666editdlrm
class-wp-application-passwords.php156170666editdlrm
class-wp-block-bindings-registry.php84630666editdlrm
class-wp-block-bindings-source.php29920666editdlrm
class-wp-block-editor-context.php13500666editdlrm
class-wp-block-list.php47570666editdlrm
class-wp-block-metadata-registry.php102270666editdlrm
class-wp-block-parser-block.php25550666editdlrm
class-wp-block-parser-frame.php20170666editdlrm
class-wp-block-parser.php115320666editdlrm
class-wp-block-pattern-categories-registry.php53710666editdlrm
class-wp-block-patterns-registry.php111850666editdlrm
class-wp-block-styles-registry.php62620666editdlrm
class-wp-block-supports.php56120666editdlrm
class-wp-block-template.php20330666editdlrm
class-wp-block-templates-registry.php72310666editdlrm
class-wp-block-type-registry.php50130666editdlrm
class-wp-block-type.php172650666editdlrm
class-wp-block.php204380666editdlrm
class-wp-classic-to-block-menu-converter.php40880666editdlrm
class-wp-comment-query.php483950666editdlrm
class-wp-comment.php93720666editdlrm
class-wp-customize-control.php257300666editdlrm
class-wp-customize-manager.php2025390666editdlrm
class-wp-customize-nav-menus.php574330666editdlrm
class-wp-customize-panel.php106370666editdlrm
class-wp-customize-section.php112090666editdlrm
class-wp-customize-setting.php298890666editdlrm
class-wp-customize-widgets.php721570666editdlrm
class-wp-date-query.php357260666editdlrm
class-wp-dependencies.php151390666editdlrm
class-wp-dependency.php26270666editdlrm
class-wp-duotone.php407830666editdlrm
class-wp-editor.php723350666editdlrm
class-wp-embed.php159940666editdlrm
class-wp-error.php75020666editdlrm
class-wp-exception.php2530666editdlrm
class-wp-fatal-error-handler.php81500666editdlrm
class-wp-feed-cache-transient.php31760666editdlrm
class-wp-feed-cache.php9690666editdlrm
class-wp-hook.php160000666editdlrm
class-wp-http-cookie.php73890666editdlrm
class-wp-http-curl.php125410666editdlrm
class-wp-http-encoding.php66890666editdlrm
class-wp-http-ixr-client.php35060666editdlrm
class-wp-http-proxy.php59800666editdlrm
class-wp-http-requests-hooks.php20220666editdlrm
class-wp-http-requests-response.php44000666editdlrm
class-wp-http-response.php29770666editdlrm
class-wp-http-streams.php168590666editdlrm
class-wp-http.php415060666editdlrm
class-wp-image-editor-gd.php198860666editdlrm
class-wp-image-editor-imagick.php391060666editdlrm
class-wp-image-editor.php169380666editdlrm
class-wp-list-util.php74430666editdlrm
class-wp-locale-switcher.php66300666editdlrm
class-wp-locale.php161110666editdlrm
class-wp-matchesmapregex.php18280666editdlrm
class-wp-meta-query.php305310666editdlrm
class-wp-metadata-lazyloader.php68330666editdlrm
class-wp-navigation-fallback.php92110666editdlrm
class-wp-network-query.php198570666editdlrm
class-wp-network.php122960666editdlrm
class-wp-object-cache.php175240666editdlrm
class-wp-oembed-controller.php69050666editdlrm
class-wp-oembed.php314750666editdlrm
class-wp-paused-extensions-storage.php51110666editdlrm
class-wp-plugin-dependencies.php253190666editdlrm
class-wp-post-type.php303400666editdlrm
class-wp-post.php64840666editdlrm
class-wp-query.php1540810666editdlrm
class-wp-recovery-mode-cookie-service.php68770666editdlrm
class-wp-recovery-mode-email-service.php111830666editdlrm
class-wp-recovery-mode-key-service.php46080666editdlrm
class-wp-recovery-mode-link-service.php34630666editdlrm
class-wp-recovery-mode.php114350666editdlrm
class-wp-rewrite.php636880666editdlrm
class-wp-role.php25230666editdlrm
class-wp-roles.php85860666editdlrm
class-wp-script-modules.php193660666editdlrm
class-wp-scripts.php283440666editdlrm
class-wp-session-tokens.php74510666editdlrm
class-wp-simplepie-file.php34080666editdlrm
class-wp-simplepie-sanitize-kses.php18370666editdlrm
class-wp-site-query.php316250666editdlrm
class-wp-site.php74540666editdlrm
class-wp-styles.php110100666editdlrm
class-wp-tax-query.php195550666editdlrm
class-wp-taxonomy.php185670666editdlrm
class-wp-term-query.php408690666editdlrm
class-wp-term.php52980666editdlrm
class-wp-text-diff-renderer-inline.php9790666editdlrm
class-wp-text-diff-renderer-table.php188070666editdlrm
class-wp-textdomain-registry.php104810666editdlrm
class-wp-theme-json-data.php18090666editdlrm
class-wp-theme-json-resolver.php358050666editdlrm
class-wp-theme-json-schema.php73670666editdlrm
class-wp-theme-json.php1607800666editdlrm
class-wp-theme.php654130666editdlrm
class-wp-token-map.php286180666editdlrm
class-wp-user-meta-session-tokens.php29900666editdlrm
class-wp-user-query.php436540666editdlrm
class-wp-user-request.php22220666editdlrm
class-wp-user.php228270666editdlrm
class-wp-walker.php133220666editdlrm
class-wp-widget-factory.php33470666editdlrm
class-wp-widget.php184240666editdlrm
class-wp-xmlrpc-server.php2149480666editdlrm
class-wp.php261190666editdlrm
class-wpdb.php1183890666editdlrm
class.wp-dependencies.php3730666editdlrm
class.wp-scripts.php3430666editdlrm
class.wp-styles.php3380666editdlrm
comment-template.php1027730666editdlrm
comment.php1302750666editdlrm
compat.php169740666editdlrm
cron.php415940666editdlrm
date.php4000666editdlrm
default-constants.php113650666editdlrm
default-filters.php356850666editdlrm
default-widgets.php22220666editdlrm
deprecated.php1901300666editdlrm
embed-template.php3380666editdlrm
embed.php379080666editdlrm
error-protection.php41210666editdlrm
feed-atom-comments.php55040666editdlrm
feed-atom.php30480666editdlrm
feed-rdf.php26680666editdlrm
feed-rss.php11890666editdlrm
feed-rss2-comments.php41360666editdlrm
feed-rss2.php37990666editdlrm
feed.php234110666editdlrm
fonts.php97510666editdlrm
formatting.php3352290666editdlrm
functions.php2831630666editdlrm
functions.wp-scripts.php145580666editdlrm
functions.wp-styles.php85830666editdlrm
general-template.php1694920666editdlrm
global-styles-and-settings.php212050666editdlrm
http.php270840666editdlrm
https-detection.php56610666editdlrm
https-migration.php47410666editdlrm
kses.php745750666editdlrm
l10n.php684150666editdlrm
link-template.php1577100666editdlrm
load.php556580666editdlrm
locale.php1620666editdlrm
media-template.php630430666editdlrm
media.php2184850666editdlrm
meta.php644090666editdlrm
ms-blogs.php257720666editdlrm
ms-default-constants.php49210666editdlrm
ms-default-filters.php66360666editdlrm
ms-deprecated.php217590666editdlrm
ms-files.php27110666editdlrm
ms-functions.php912490666editdlrm
ms-load.php198830666editdlrm
ms-network.php37820666editdlrm
ms-settings.php41240666editdlrm
ms-site.php404900666editdlrm
nav-menu-template.php259170666editdlrm
nav-menu.php443470666editdlrm
option.php1017590666editdlrm
pluggable-deprecated.php62630666editdlrm
pluggable.php1159700666editdlrm
plugin.php354650666editdlrm
post-formats.php71020666editdlrm
post-template.php668800666editdlrm
post-thumbnail-template.php108260666editdlrm
post.php2898940666editdlrm
query.php370350666editdlrm
registration-functions.php2000666editdlrm
registration.php2000666editdlrm
rest-api.php995930666editdlrm
revision.php308900666editdlrm
rewrite.php195410666editdlrm
robots-template.php51850666editdlrm
rss-functions.php2550666editdlrm
rss.php231130666editdlrm
script-loader.php1307350666editdlrm
script-modules.php77120666editdlrm
session.php2580666editdlrm
shortcodes.php240510666editdlrm
sitemaps.php32380666editdlrm
spl-autoload-compat.php4410666editdlrm
style-engine.php75630666editdlrm
taxonomy.php1754380666editdlrm
template-canvas.php5440666editdlrm
template-loader.php33500666editdlrm
template.php241540666editdlrm
theme-i18n.json12920666editdlrm
theme-previews.php28320666editdlrm
theme-templates.php62230666editdlrm
theme.json87040666editdlrm
theme.php1339850666editdlrm
update.php367880666editdlrm
user.php1750580666editdlrm
vars.php64890666editdlrm
version.php9310666editdlrm
widgets.php706820666editdlrm
wp-db.php4450666editdlrm
wp-diff.php7260666editdlrm
Edit: /var/www/p4ela.net/www/wp-includes/class-wp-recovery-mode-cookie-service.php (6877B)
generate_cookie(); /** * Filters the length of time a Recovery Mode cookie is valid for. * * @since 5.2.0 * * @param int $length Length in seconds. */ $length = apply_filters( 'recovery_mode_cookie_length', WEEK_IN_SECONDS ); $expire = time() + $length; setcookie( RECOVERY_MODE_COOKIE, $value, $expire, COOKIEPATH, COOKIE_DOMAIN, is_ssl(), true ); if ( COOKIEPATH !== SITECOOKIEPATH ) { setcookie( RECOVERY_MODE_COOKIE, $value, $expire, SITECOOKIEPATH, COOKIE_DOMAIN, is_ssl(), true ); } } /** * Clears the recovery mode cookie. * * @since 5.2.0 */ public function clear_cookie() { setcookie( RECOVERY_MODE_COOKIE, ' ', time() - YEAR_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN ); setcookie( RECOVERY_MODE_COOKIE, ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH, COOKIE_DOMAIN ); } /** * Validates the recovery mode cookie. * * @since 5.2.0 * * @param string $cookie Optionally specify the cookie string. * If omitted, it will be retrieved from the super global. * @return true|WP_Error True on success, error object on failure. */ public function validate_cookie( $cookie = '' ) { if ( ! $cookie ) { if ( empty( $_COOKIE[ RECOVERY_MODE_COOKIE ] ) ) { return new WP_Error( 'no_cookie', __( 'No cookie present.' ) ); } $cookie = $_COOKIE[ RECOVERY_MODE_COOKIE ]; } $parts = $this->parse_cookie( $cookie ); if ( is_wp_error( $parts ) ) { return $parts; } list( , $created_at, $random, $signature ) = $parts; if ( ! ctype_digit( $created_at ) ) { return new WP_Error( 'invalid_created_at', __( 'Invalid cookie format.' ) ); } /** This filter is documented in wp-includes/class-wp-recovery-mode-cookie-service.php */ $length = apply_filters( 'recovery_mode_cookie_length', WEEK_IN_SECONDS ); if ( time() > $created_at + $length ) { return new WP_Error( 'expired', __( 'Cookie expired.' ) ); } $to_sign = sprintf( 'recovery_mode|%s|%s', $created_at, $random ); $hashed = $this->recovery_mode_hash( $to_sign ); if ( ! hash_equals( $signature, $hashed ) ) { return new WP_Error( 'signature_mismatch', __( 'Invalid cookie.' ) ); } return true; } /** * Gets the session identifier from the cookie. * * The cookie should be validated before calling this API. * * @since 5.2.0 * * @param string $cookie Optionally specify the cookie string. * If omitted, it will be retrieved from the super global. * @return string|WP_Error Session ID on success, or error object on failure. */ public function get_session_id_from_cookie( $cookie = '' ) { if ( ! $cookie ) { if ( empty( $_COOKIE[ RECOVERY_MODE_COOKIE ] ) ) { return new WP_Error( 'no_cookie', __( 'No cookie present.' ) ); } $cookie = $_COOKIE[ RECOVERY_MODE_COOKIE ]; } $parts = $this->parse_cookie( $cookie ); if ( is_wp_error( $parts ) ) { return $parts; } list( , , $random ) = $parts; return sha1( $random ); } /** * Parses the cookie into its four parts. * * @since 5.2.0 * * @param string $cookie Cookie content. * @return array|WP_Error Cookie parts array, or error object on failure. */ private function parse_cookie( $cookie ) { $cookie = base64_decode( $cookie ); $parts = explode( '|', $cookie ); if ( 4 !== count( $parts ) ) { return new WP_Error( 'invalid_format', __( 'Invalid cookie format.' ) ); } return $parts; } /** * Generates the recovery mode cookie value. * * The cookie is a base64 encoded string with the following format: * * recovery_mode|iat|rand|signature * * Where "recovery_mode" is a constant string, * iat is the time the cookie was generated at, * rand is a randomly generated password that is also used as a session identifier * and signature is an hmac of the preceding 3 parts. * * @since 5.2.0 * * @return string Generated cookie content. */ private function generate_cookie() { $to_sign = sprintf( 'recovery_mode|%s|%s', time(), wp_generate_password( 20, false ) ); $signed = $this->recovery_mode_hash( $to_sign ); return base64_encode( sprintf( '%s|%s', $to_sign, $signed ) ); } /** * Gets a form of `wp_hash()` specific to Recovery Mode. * * We cannot use `wp_hash()` because it is defined in `pluggable.php` which is not loaded until after plugins are loaded, * which is too late to verify the recovery mode cookie. * * This tries to use the `AUTH` salts first, but if they aren't valid specific salts will be generated and stored. * * @since 5.2.0 * * @param string $data Data to hash. * @return string|false The hashed $data, or false on failure. */ private function recovery_mode_hash( $data ) { $default_keys = array_unique( array( 'put your unique phrase here', /* * translators: This string should only be translated if wp-config-sample.php is localized. * You can check the localized release package or * https://i18n.svn.wordpress.org//branches//dist/wp-config-sample.php */ __( 'put your unique phrase here' ), ) ); if ( ! defined( 'AUTH_KEY' ) || in_array( AUTH_KEY, $default_keys, true ) ) { $auth_key = get_site_option( 'recovery_mode_auth_key' ); if ( ! $auth_key ) { if ( ! function_exists( 'wp_generate_password' ) ) { require_once ABSPATH . WPINC . '/pluggable.php'; } $auth_key = wp_generate_password( 64, true, true ); update_site_option( 'recovery_mode_auth_key', $auth_key ); } } else { $auth_key = AUTH_KEY; } if ( ! defined( 'AUTH_SALT' ) || in_array( AUTH_SALT, $default_keys, true ) || AUTH_SALT === $auth_key ) { $auth_salt = get_site_option( 'recovery_mode_auth_salt' ); if ( ! $auth_salt ) { if ( ! function_exists( 'wp_generate_password' ) ) { require_once ABSPATH . WPINC . '/pluggable.php'; } $auth_salt = wp_generate_password( 64, true, true ); update_site_option( 'recovery_mode_auth_salt', $auth_salt ); } } else { $auth_salt = AUTH_SALT; } $secret = $auth_key . $auth_salt; return hash_hmac( 'sha1', $data, $secret ); } }