Submit
Path:
~
/
/
proc
/
self
/
cwd
/
wp
/
wp-includes
/
File Content:
class-wp-http-cookie.php
<?php /** * HTTP API: WP_Http_Cookie class * * @package WordPress * @subpackage HTTP * @since 4.4.0 */ /** * Core class used to encapsulate a single cookie object for internal use. * * Returned cookies are represented using this class, and when cookies are set, if they are not * already a WP_Http_Cookie() object, then they are turned into one. * * @todo The WordPress convention is to use underscores instead of camelCase for function and method * names. Need to switch to use underscores instead for the methods. * * @since 2.8.0 */ class WP_Http_Cookie { /** * Cookie name. * * @since 2.8.0 * @var string */ public $name; /** * Cookie value. * * @since 2.8.0 * @var string */ public $value; /** * When the cookie expires. * * @since 2.8.0 * @var string */ public $expires; /** * Cookie URL path. * * @since 2.8.0 * @var string */ public $path; /** * Cookie Domain. * * @since 2.8.0 * @var string */ public $domain; /** * Sets up this cookie object. * * The parameter $data should be either an associative array containing the indices names below * or a header string detailing it. * * @since 2.8.0 * * @param string|array $data { * Raw cookie data as header string or data array. * * @type string $name Cookie name. * @type mixed $value Value. Should NOT already be urlencoded. * @type string|int $expires Optional. Unix timestamp or formatted date. Default null. * @type string $path Optional. Path. Default '/'. * @type string $domain Optional. Domain. Default host of parsed $requested_url. * @type int $port Optional. Port. Default null. * } * @param string $requested_url The URL which the cookie was set on, used for default $domain * and $port values. */ public function __construct( $data, $requested_url = '' ) { if ( $requested_url ) $arrURL = @parse_url( $requested_url ); if ( isset( $arrURL['host'] ) ) $this->domain = $arrURL['host']; $this->path = isset( $arrURL['path'] ) ? $arrURL['path'] : '/'; if ( '/' != substr( $this->path, -1 ) ) $this->path = dirname( $this->path ) . '/'; if ( is_string( $data ) ) { // Assume it's a header string direct from a previous request. $pairs = explode( ';', $data ); // Special handling for first pair; name=value. Also be careful of "=" in value. $name = trim( substr( $pairs[0], 0, strpos( $pairs[0], '=' ) ) ); $value = substr( $pairs[0], strpos( $pairs[0], '=' ) + 1 ); $this->name = $name; $this->value = urldecode( $value ); // Removes name=value from items. array_shift( $pairs ); // Set everything else as a property. foreach ( $pairs as $pair ) { $pair = rtrim($pair); // Handle the cookie ending in ; which results in a empty final pair. if ( empty($pair) ) continue; list( $key, $val ) = strpos( $pair, '=' ) ? explode( '=', $pair ) : array( $pair, '' ); $key = strtolower( trim( $key ) ); if ( 'expires' == $key ) $val = strtotime( $val ); $this->$key = $val; } } else { if ( !isset( $data['name'] ) ) return; // Set properties based directly on parameters. foreach ( array( 'name', 'value', 'path', 'domain', 'port' ) as $field ) { if ( isset( $data[ $field ] ) ) $this->$field = $data[ $field ]; } if ( isset( $data['expires'] ) ) $this->expires = is_int( $data['expires'] ) ? $data['expires'] : strtotime( $data['expires'] ); else $this->expires = null; } } /** * Confirms that it's OK to send this cookie to the URL checked against. * * Decision is based on RFC 2109/2965, so look there for details on validity. * * @since 2.8.0 * * @param string $url URL you intend to send this cookie to * @return bool true if allowed, false otherwise. */ public function test( $url ) { if ( is_null( $this->name ) ) return false; // Expires - if expired then nothing else matters. if ( isset( $this->expires ) && time() > $this->expires ) return false; // Get details on the URL we're thinking about sending to. $url = parse_url( $url ); $url['port'] = isset( $url['port'] ) ? $url['port'] : ( 'https' == $url['scheme'] ? 443 : 80 ); $url['path'] = isset( $url['path'] ) ? $url['path'] : '/'; // Values to use for comparison against the URL. $path = isset( $this->path ) ? $this->path : '/'; $port = isset( $this->port ) ? $this->port : null; $domain = isset( $this->domain ) ? strtolower( $this->domain ) : strtolower( $url['host'] ); if ( false === stripos( $domain, '.' ) ) $domain .= '.local'; // Host - very basic check that the request URL ends with the domain restriction (minus leading dot). $domain = substr( $domain, 0, 1 ) == '.' ? substr( $domain, 1 ) : $domain; if ( substr( $url['host'], -strlen( $domain ) ) != $domain ) return false; // Port - supports "port-lists" in the format: "80,8000,8080". if ( !empty( $port ) && !in_array( $url['port'], explode( ',', $port) ) ) return false; // Path - request path must start with path restriction. if ( substr( $url['path'], 0, strlen( $path ) ) != $path ) return false; return true; } /** * Convert cookie name and value back to header string. * * @since 2.8.0 * * @return string Header encoded cookie name and value. */ public function getHeaderValue() { if ( ! isset( $this->name ) || ! isset( $this->value ) ) return ''; /** * Filters the header-encoded cookie value. * * @since 3.4.0 * * @param string $value The cookie value. * @param string $name The cookie name. */ return $this->name . '=' . apply_filters( 'wp_http_cookie_value', $this->value, $this->name ); } /** * Retrieve cookie header for usage in the rest of the WordPress HTTP API. * * @since 2.8.0 * * @return string */ public function getFullHeader() { return 'Cookie: ' . $this->getHeaderValue(); } /** * Retrieves cookie attributes. * * @since 4.6.0 * * @return array { * List of attributes. * * @type string $expires When the cookie expires. * @type string $path Cookie URL path. * @type string $domain Cookie domain. * } */ public function get_attributes() { return array( 'expires' => $this->expires, 'path' => $this->path, 'domain' => $this->domain, ); } }
Submit
FILE
FOLDER
Name
Size
Permission
Action
ID3
---
0755
IXR
---
0755
Requests
---
0755
SimplePie
---
0755
Text
---
0755
certificates
---
0755
css
---
0755
customize
---
0755
fonts
---
0755
images
---
0755
js
---
0755
pomo
---
0755
random_compat
---
0755
rest-api
---
0755
theme-compat
---
0755
widgets
---
0755
admin-bar.php
28650 bytes
0644
atomlib.php
11839 bytes
0644
author-template.php
16123 bytes
0644
bookmark-template.php
11699 bytes
0644
bookmark.php
13682 bytes
0644
cache.php
21621 bytes
0644
canonical.php
27583 bytes
0644
capabilities.php
28214 bytes
0644
category-template.php
51324 bytes
0644
category.php
11984 bytes
0644
class-IXR.php
2573 bytes
0644
class-feed.php
522 bytes
0644
class-http.php
36164 bytes
0644
class-json.php
40472 bytes
0644
class-oembed.php
33112 bytes
0644
class-phpass.php
7317 bytes
0644
class-phpmailer.php
148234 bytes
0644
class-pop3.php
20919 bytes
0644
class-requests.php
29790 bytes
0644
class-simplepie.php
89264 bytes
0644
class-smtp.php
39478 bytes
0644
class-snoopy.php
37785 bytes
0644
class-walker-category-dropdown.php
2099 bytes
0644
class-walker-category.php
6641 bytes
0644
class-walker-comment.php
11173 bytes
0644
class-walker-nav-menu.php
8392 bytes
0644
class-walker-page-dropdown.php
2279 bytes
0644
class-walker-page.php
6713 bytes
0644
class-wp-admin-bar.php
16969 bytes
0644
class-wp-ajax-response.php
5024 bytes
0644
class-wp-comment-query.php
41743 bytes
0644
class-wp-comment.php
8936 bytes
0644
class-wp-customize-control.php
24984 bytes
0644
class-wp-customize-manager.php
199142 bytes
0644
class-wp-customize-nav-menus.php
53561 bytes
0644
class-wp-customize-panel.php
9576 bytes
0644
class-wp-customize-section.php
10197 bytes
0644
class-wp-customize-setting.php
28132 bytes
0644
class-wp-customize-widgets.php
65738 bytes
0644
class-wp-dependency.php
1550 bytes
0644
class-wp-editor.php
60699 bytes
0644
class-wp-embed.php
14509 bytes
0644
class-wp-error.php
4585 bytes
0644
class-wp-feed-cache-transient.php
2537 bytes
0644
class-wp-feed-cache.php
745 bytes
0644
class-wp-hook.php
14052 bytes
0644
class-wp-http-cookie.php
6456 bytes
0644
class-wp-http-curl.php
11679 bytes
0644
class-wp-http-encoding.php
6444 bytes
0644
class-wp-http-ixr-client.php
3250 bytes
0644
class-wp-http-proxy.php
5957 bytes
0644
class-wp-http-requests-hooks.php
1872 bytes
0644
class-wp-http-requests-response.php
4273 bytes
0644
class-wp-http-response.php
2871 bytes
0644
class-wp-http-streams.php
14995 bytes
0644
class-wp-image-editor-gd.php
12921 bytes
0644
class-wp-image-editor-imagick.php
21676 bytes
0644
class-wp-image-editor.php
11730 bytes
0644
class-wp-list-util.php
6369 bytes
0644
class-wp-locale-switcher.php
5059 bytes
0644
class-wp-locale.php
14547 bytes
0644
class-wp-matchesmapregex.php
1796 bytes
0644
class-wp-meta-query.php
22283 bytes
0644
class-wp-metadata-lazyloader.php
5372 bytes
0644
class-wp-network-query.php
17126 bytes
0644
class-wp-network.php
12129 bytes
0644
class-wp-oembed-controller.php
5587 bytes
0644
class-wp-post-type.php
18236 bytes
0644
class-wp-post.php
6355 bytes
0644
class-wp-query.php
124799 bytes
0644
class-wp-rewrite.php
58908 bytes
0644
class-wp-role.php
2614 bytes
0644
class-wp-roles.php
8187 bytes
0644
class-wp-session-tokens.php
7338 bytes
0644
class-wp-simplepie-file.php
2272 bytes
0644
class-wp-simplepie-sanitize-kses.php
1774 bytes
0644
class-wp-site-query.php
23187 bytes
0644
class-wp-site.php
7318 bytes
0644
class-wp-tax-query.php
19370 bytes
0644
class-wp-taxonomy.php
9993 bytes
0644
class-wp-term-query.php
34167 bytes
0644
class-wp-term.php
5273 bytes
0644
class-wp-text-diff-renderer-inline.php
712 bytes
0644
class-wp-text-diff-renderer-table.php
15194 bytes
0644
class-wp-theme.php
47879 bytes
0644
class-wp-user-meta-session-tokens.php
2916 bytes
0644
class-wp-user-query.php
29525 bytes
0644
class-wp-user.php
20679 bytes
0644
class-wp-walker.php
12378 bytes
0644
class-wp-widget-factory.php
3746 bytes
0644
class-wp-widget.php
17658 bytes
0644
class-wp-xmlrpc-server.php
201903 bytes
0644
class-wp.php
23974 bytes
0644
class.wp-dependencies.php
11185 bytes
0644
class.wp-scripts.php
14160 bytes
0644
class.wp-styles.php
9794 bytes
0644
comment-template.php
88213 bytes
0644
comment.php
111877 bytes
0644
compat.php
16226 bytes
0644
cron.php
16467 bytes
0644
date.php
35454 bytes
0644
default-constants.php
9562 bytes
0644
default-filters.php
27153 bytes
0644
default-widgets.php
2180 bytes
0644
deprecated.php
113803 bytes
0644
embed-template.php
344 bytes
0644
embed.php
44609 bytes
0644
feed-atom-comments.php
5357 bytes
0644
feed-atom.php
3090 bytes
0644
feed-rdf.php
2670 bytes
0644
feed-rss.php
1246 bytes
0644
feed-rss2-comments.php
4064 bytes
0644
feed-rss2.php
3773 bytes
0644
feed.php
19550 bytes
0644
formatting.php
272439 bytes
0644
functions.php
189404 bytes
0644
functions.wp-scripts.php
11481 bytes
0644
functions.wp-styles.php
8080 bytes
0644
general-template.php
139687 bytes
0644
http.php
22182 bytes
0644
kses.php
51619 bytes
0644
l10n.php
43479 bytes
0644
link-template.php
136453 bytes
0644
load.php
33907 bytes
0644
locale.php
141 bytes
0644
media-template.php
46133 bytes
0644
media.php
140448 bytes
0644
meta.php
43164 bytes
0644
ms-blogs.php
39181 bytes
0644
ms-default-constants.php
4715 bytes
0644
ms-default-filters.php
4653 bytes
0644
ms-deprecated.php
16158 bytes
0644
ms-files.php
2620 bytes
0644
ms-functions.php
91131 bytes
0644
ms-load.php
19248 bytes
0644
ms-settings.php
4088 bytes
0644
nav-menu-template.php
20871 bytes
0644
nav-menu.php
39526 bytes
0644
option.php
67744 bytes
0644
pluggable-deprecated.php
6262 bytes
0644
pluggable.php
92521 bytes
0644
plugin.php
31677 bytes
0644
post-formats.php
6976 bytes
0644
post-template.php
58362 bytes
0644
post-thumbnail-template.php
8216 bytes
0644
post.php
222620 bytes
0644
query.php
25617 bytes
0644
registration-functions.php
178 bytes
0644
registration.php
178 bytes
0644
rest-api.php
38673 bytes
0644
revision.php
21305 bytes
0644
rewrite.php
17502 bytes
0644
rss-functions.php
191 bytes
0644
rss.php
23208 bytes
0644
script-loader.php
80159 bytes
0644
session.php
242 bytes
0644
shortcodes.php
20441 bytes
0644
spl-autoload-compat.php
2574 bytes
0644
taxonomy.php
150619 bytes
0644
template-loader.php
2896 bytes
0644
template.php
19792 bytes
0644
theme.php
99777 bytes
0644
update.php
24691 bytes
0644
user.php
121078 bytes
0644
vars.php
5582 bytes
0644
version.php
620 bytes
0644
widgets.php
55468 bytes
0644
wlwmanifest.xml
1045 bytes
0644
wp-db.php
99474 bytes
0644
wp-diff.php
661 bytes
0644
N4ST4R_ID | Naxtarrr