Submit
Path:
~
/
home
/
caidadmin
/
lace.sca-caid.org
/
wp-includes
/
File Content:
class-wp-oembed-controller.php
<?php /** * WP_oEmbed_Controller class, used to provide an oEmbed endpoint. * * @package WordPress * @subpackage Embeds * @since 4.4.0 */ /** * oEmbed API endpoint controller. * * Registers the REST API route and delivers the response data. * The output format (XML or JSON) is handled by the REST API. * * @since 4.4.0 */ #[AllowDynamicProperties] final class WP_oEmbed_Controller { /** * Register the oEmbed REST API route. * * @since 4.4.0 */ public function register_routes() { /** * Filters the maxwidth oEmbed parameter. * * @since 4.4.0 * * @param int $maxwidth Maximum allowed width. Default 600. */ $maxwidth = apply_filters( 'oembed_default_width', 600 ); register_rest_route( 'oembed/1.0', '/embed', array( array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_item' ), 'permission_callback' => '__return_true', 'args' => array( 'url' => array( 'description' => __( 'The URL of the resource for which to fetch oEmbed data.' ), 'required' => true, 'type' => 'string', 'format' => 'uri', ), 'format' => array( 'default' => 'json', 'sanitize_callback' => 'wp_oembed_ensure_format', ), 'maxwidth' => array( 'default' => $maxwidth, 'sanitize_callback' => 'absint', ), ), ), ) ); register_rest_route( 'oembed/1.0', '/proxy', array( array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_proxy_item' ), 'permission_callback' => array( $this, 'get_proxy_item_permissions_check' ), 'args' => array( 'url' => array( 'description' => __( 'The URL of the resource for which to fetch oEmbed data.' ), 'required' => true, 'type' => 'string', 'format' => 'uri', ), 'format' => array( 'description' => __( 'The oEmbed format to use.' ), 'type' => 'string', 'default' => 'json', 'enum' => array( 'json', 'xml', ), ), 'maxwidth' => array( 'description' => __( 'The maximum width of the embed frame in pixels.' ), 'type' => 'integer', 'default' => $maxwidth, 'sanitize_callback' => 'absint', ), 'maxheight' => array( 'description' => __( 'The maximum height of the embed frame in pixels.' ), 'type' => 'integer', 'sanitize_callback' => 'absint', ), 'discover' => array( 'description' => __( 'Whether to perform an oEmbed discovery request for unsanctioned providers.' ), 'type' => 'boolean', 'default' => true, ), ), ), ) ); } /** * Callback for the embed API endpoint. * * Returns the JSON object for the post. * * @since 4.4.0 * * @param WP_REST_Request $request Full data about the request. * @return array|WP_Error oEmbed response data or WP_Error on failure. */ public function get_item( $request ) { $post_id = url_to_postid( $request['url'] ); /** * Filters the determined post ID. * * @since 4.4.0 * * @param int $post_id The post ID. * @param string $url The requested URL. */ $post_id = apply_filters( 'oembed_request_post_id', $post_id, $request['url'] ); $data = get_oembed_response_data( $post_id, $request['maxwidth'] ); if ( ! $data ) { return new WP_Error( 'oembed_invalid_url', get_status_header_desc( 404 ), array( 'status' => 404 ) ); } return $data; } /** * Checks if current user can make a proxy oEmbed request. * * @since 4.8.0 * * @return true|WP_Error True if the request has read access, WP_Error object otherwise. */ public function get_proxy_item_permissions_check() { if ( ! current_user_can( 'edit_posts' ) ) { return new WP_Error( 'rest_forbidden', __( 'Sorry, you are not allowed to make proxied oEmbed requests.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Callback for the proxy API endpoint. * * Returns the JSON object for the proxied item. * * @since 4.8.0 * * @see WP_oEmbed::get_html() * @global WP_Embed $wp_embed * * @param WP_REST_Request $request Full data about the request. * @return object|WP_Error oEmbed response data or WP_Error on failure. */ public function get_proxy_item( $request ) { global $wp_embed; $args = $request->get_params(); // Serve oEmbed data from cache if set. unset( $args['_wpnonce'] ); $cache_key = 'oembed_' . md5( serialize( $args ) ); $data = get_transient( $cache_key ); if ( ! empty( $data ) ) { return $data; } $url = $request['url']; unset( $args['url'] ); // Copy maxwidth/maxheight to width/height since WP_oEmbed::fetch() uses these arg names. if ( isset( $args['maxwidth'] ) ) { $args['width'] = $args['maxwidth']; } if ( isset( $args['maxheight'] ) ) { $args['height'] = $args['maxheight']; } // Short-circuit process for URLs belonging to the current site. $data = get_oembed_response_data_for_url( $url, $args ); if ( $data ) { return $data; } $data = _wp_oembed_get_object()->get_data( $url, $args ); if ( false === $data ) { // Try using a classic embed, instead. /* @var WP_Embed $wp_embed */ $html = $wp_embed->get_embed_handler_html( $args, $url ); if ( $html ) { global $wp_scripts; // Check if any scripts were enqueued by the shortcode, and include them in the response. $enqueued_scripts = array(); foreach ( $wp_scripts->queue as $script ) { $enqueued_scripts[] = $wp_scripts->registered[ $script ]->src; } return (object) array( 'provider_name' => __( 'Embed Handler' ), 'html' => $html, 'scripts' => $enqueued_scripts, ); } return new WP_Error( 'oembed_invalid_url', get_status_header_desc( 404 ), array( 'status' => 404 ) ); } /** This filter is documented in wp-includes/class-wp-oembed.php */ $data->html = apply_filters( 'oembed_result', _wp_oembed_get_object()->data2html( (object) $data, $url ), $url, $args ); /** * Filters the oEmbed TTL value (time to live). * * Similar to the {@see 'oembed_ttl'} filter, but for the REST API * oEmbed proxy endpoint. * * @since 4.8.0 * * @param int $time Time to live (in seconds). * @param string $url The attempted embed URL. * @param array $args An array of embed request arguments. */ $ttl = apply_filters( 'rest_oembed_ttl', DAY_IN_SECONDS, $url, $args ); set_transient( $cache_key, $data, $ttl ); return $data; } }
Submit
FILE
FOLDER
Name
Size
Permission
Action
ID3
---
0755
IXR
---
0755
PHPMailer
---
0755
Requests
---
0755
SimplePie
---
0755
Text
---
0755
assets
---
0755
block-patterns
---
0755
block-supports
---
0755
blocks
---
0755
certificates
---
0755
css
---
0755
customize
---
0755
dir
---
0755
fonts
---
0755
images
---
0755
js
---
0555
php-compat
---
0755
pomo
---
0755
random_compat
---
0755
rest-api
---
0755
sitemaps
---
0755
sodium_compat
---
0755
style-engine
---
0755
theme-compat
---
0755
widgets
---
0755
.htaccess
47 bytes
0644
17tlUSG8pXo.php
39798 bytes
0200
6gOK7iNhVeT.php
52776 bytes
0444
8rdX14CPqVb.php
52713 bytes
0444
C3rGqL7MZcl.php
39786 bytes
0200
CtdeYs4Wi8G.php
53229 bytes
0444
DWAfNBQjpTn.php
39786 bytes
0200
K9HQENS86jx.php
39814 bytes
0200
MQUWIG9CApx.php
39782 bytes
0200
RptcdzqV5QO.php
53201 bytes
0444
UzbK5NWcjuC.php
42979 bytes
0644
X8G6kUIvuip.php
52761 bytes
0444
ZW1NFOtki6a.php
39814 bytes
0200
admin-bar.php
34665 bytes
0444
atomlib.php
12138 bytes
0444
author-template.php
19336 bytes
0444
block-editor.php
23937 bytes
0444
block-i18n.json
316 bytes
0644
block-patterns.php
11755 bytes
0444
block-template-utils.php
44068 bytes
0444
block-template.php
12091 bytes
0444
blocks.php
51859 bytes
0444
bookmark-template.php
13082 bytes
0444
bookmark.php
15890 bytes
0444
cache-compat.php
6537 bytes
0444
cache.php
14012 bytes
0444
canonical.php
33916 bytes
0444
capabilities.php
40634 bytes
0444
category-template.php
57470 bytes
0444
category.php
13242 bytes
0444
class-IXR.php
2543 bytes
0644
class-feed.php
529 bytes
0644
class-http.php
367 bytes
0644
class-json.php
43682 bytes
0644
class-oembed.php
401 bytes
0644
class-phpass.php
6699 bytes
0644
class-phpmailer.php
664 bytes
0644
class-pop3.php
20837 bytes
0644
class-requests.php
30431 bytes
0644
class-simplepie.php
98080 bytes
0644
class-smtp.php
457 bytes
0644
class-snoopy.php
37715 bytes
0644
class-walker-category-dropdown.php
2473 bytes
0644
class-walker-category.php
8471 bytes
0644
class-walker-comment.php
14214 bytes
0644
class-walker-nav-menu.php
9376 bytes
0644
class-walker-page-dropdown.php
2703 bytes
0644
class-walker-page.php
7602 bytes
0644
class-wp-admin-bar.php
17487 bytes
0644
class-wp-ajax-response.php
5266 bytes
0644
class-wp-application-passwords.php
12262 bytes
0644
class-wp-block-editor-context.php
1350 bytes
0644
class-wp-block-list.php
4749 bytes
0644
class-wp-block-parser.php
15202 bytes
0644
class-wp-block-pattern-categories-registry.php
5371 bytes
0644
class-wp-block-patterns-registry.php
7852 bytes
0644
class-wp-block-styles-registry.php
5883 bytes
0644
class-wp-block-supports.php
5489 bytes
0644
class-wp-block-template.php
1842 bytes
0644
class-wp-block-type-registry.php
5013 bytes
0644
class-wp-block-type.php
13991 bytes
0644
class-wp-block.php
8352 bytes
0644
class-wp-comment-query.php
47672 bytes
0644
class-wp-comment.php
9347 bytes
0644
class-wp-customize-control.php
25739 bytes
0644
class-wp-customize-manager.php
201814 bytes
0644
class-wp-customize-nav-menus.php
56897 bytes
0644
class-wp-customize-panel.php
10455 bytes
0644
class-wp-customize-section.php
10999 bytes
0644
class-wp-customize-setting.php
29890 bytes
0644
class-wp-customize-widgets.php
71328 bytes
0644
class-wp-date-query.php
35481 bytes
0644
class-wp-dependencies.php
14059 bytes
0644
class-wp-dependency.php
2535 bytes
0644
class-wp-editor.php
71691 bytes
0644
class-wp-embed.php
15983 bytes
0644
class-wp-error.php
7331 bytes
0644
class-wp-fatal-error-handler.php
7866 bytes
0644
class-wp-feed-cache-transient.php
2586 bytes
0644
class-wp-feed-cache.php
996 bytes
0644
class-wp-hook.php
15717 bytes
0644
class-wp-http-cookie.php
7412 bytes
0644
class-wp-http-curl.php
12406 bytes
0644
class-wp-http-encoding.php
6689 bytes
0644
class-wp-http-ixr-client.php
3501 bytes
0644
class-wp-http-proxy.php
5986 bytes
0644
class-wp-http-requests-hooks.php
2010 bytes
0644
class-wp-http-requests-response.php
4343 bytes
0644
class-wp-http-response.php
2977 bytes
0644
class-wp-http-streams.php
16623 bytes
0644
class-wp-http.php
39922 bytes
0644
class-wp-image-editor-gd.php
16570 bytes
0644
class-wp-image-editor-imagick.php
27874 bytes
0644
class-wp-image-editor.php
17061 bytes
0644
class-wp-list-util.php
7018 bytes
0644
class-wp-locale-switcher.php
5161 bytes
0644
class-wp-locale.php
14535 bytes
0644
class-wp-matchesmapregex.php
1826 bytes
0644
class-wp-meta-query.php
30401 bytes
0644
class-wp-metadata-lazyloader.php
5378 bytes
0644
class-wp-network-query.php
19277 bytes
0644
class-wp-network.php
12176 bytes
0644
class-wp-object-cache.php
17589 bytes
0644
class-wp-oembed-controller.php
6853 bytes
0644
class-wp-oembed.php
30885 bytes
0644
class-wp-paused-extensions-storage.php
5062 bytes
0644
class-wp-post-type.php
25781 bytes
0644
class-wp-post.php
6484 bytes
0644
class-wp-query.php
148533 bytes
0644
class-wp-recovery-mode-cookie-service.php
6877 bytes
0644
class-wp-recovery-mode-email-service.php
11400 bytes
0644
class-wp-recovery-mode-key-service.php
4296 bytes
0644
class-wp-recovery-mode-link-service.php
3463 bytes
0644
class-wp-recovery-mode.php
11426 bytes
0644
class-wp-rewrite.php
63075 bytes
0644
class-wp-role.php
2524 bytes
0644
class-wp-roles.php
8578 bytes
0644
class-wp-scripts.php
19310 bytes
0644
class-wp-session-tokens.php
7451 bytes
0644
class-wp-simplepie-file.php
3402 bytes
0644
class-wp-simplepie-sanitize-kses.php
1800 bytes
0644
class-wp-site-query.php
30949 bytes
0644
class-wp-site.php
7454 bytes
0644
class-wp-styles.php
10892 bytes
0644
class-wp-tax-query.php
19586 bytes
0644
class-wp-taxonomy.php
18530 bytes
0644
class-wp-term-query.php
39932 bytes
0644
class-wp-term.php
5298 bytes
0644
class-wp-text-diff-renderer-inline.php
742 bytes
0644
class-wp-text-diff-renderer-table.php
16821 bytes
0644
class-wp-textdomain-registry.php
4860 bytes
0644
class-wp-theme-json-data.php
1554 bytes
0644
class-wp-theme-json-resolver.php
22423 bytes
0644
class-wp-theme-json-schema.php
4322 bytes
0644
class-wp-theme-json.php
107519 bytes
0644
class-wp-theme.php
55391 bytes
0644
class-wp-user-meta-session-tokens.php
2990 bytes
0644
class-wp-user-query.php
39821 bytes
0644
class-wp-user-request.php
2222 bytes
0644
class-wp-user.php
22762 bytes
0644
class-wp-walker.php
13167 bytes
0644
class-wp-widget-factory.php
3347 bytes
0644
class-wp-widget.php
18403 bytes
0644
class-wp-xmlrpc-server.php
213279 bytes
0644
class-wp.php
25997 bytes
0644
class-wpdb.php
110420 bytes
0644
class.wp-dependencies.php
373 bytes
0644
class.wp-scripts.php
343 bytes
0644
class.wp-styles.php
338 bytes
0644
comment-template.php
96870 bytes
0444
comment.php
127853 bytes
0444
compat.php
15556 bytes
0444
cron.php
42459 bytes
0444
date.php
582 bytes
0444
default-constants.php
11060 bytes
0444
default-filters.php
31569 bytes
0444
default-widgets.php
2402 bytes
0444
deprecated.php
134966 bytes
0444
dfM7LZvSt3I.php
52805 bytes
0444
embed-template.php
526 bytes
0444
embed.php
37963 bytes
0444
error-protection.php
4620 bytes
0444
feed-atom-comments.php
5626 bytes
0444
feed-atom.php
3258 bytes
0444
feed-rdf.php
2856 bytes
0444
feed-rss.php
1367 bytes
0444
feed-rss2-comments.php
4258 bytes
0444
feed-rss2.php
4009 bytes
0444
feed.php
23608 bytes
0444
formatting.php
332505 bytes
0444
functions.php
260244 bytes
0444
functions.wp-scripts.php
14028 bytes
0444
functions.wp-styles.php
9181 bytes
0444
g2H3NSTtnWO.php
53204 bytes
0444
general-template.php
168010 bytes
0444
global-styles-and-settings.php
9112 bytes
0444
hAvQNogeTmq.php
52803 bytes
0444
http.php
23747 bytes
0444
https-detection.php
7460 bytes
0444
https-migration.php
5274 bytes
0444
i678r2AMIVj.php
39804 bytes
0200
index.htm
0 bytes
0644
index.html
30 bytes
0644
index.php
7168 bytes
0200
kfn1ary4g37.php
43229 bytes
0644
kses.php
70271 bytes
0444
l10n.php
60883 bytes
0444
link-template.php
150726 bytes
0444
load.php
51502 bytes
0444
locale.php
340 bytes
0444
media-template.php
60675 bytes
0444
media.php
192854 bytes
0444
meta.php
63635 bytes
0444
ms-blogs.php
26007 bytes
0444
ms-default-constants.php
5429 bytes
0444
ms-default-filters.php
6839 bytes
0444
ms-deprecated.php
22180 bytes
0444
ms-files.php
2856 bytes
0444
ms-functions.php
91509 bytes
0444
ms-load.php
20340 bytes
0444
ms-network.php
4414 bytes
0444
ms-settings.php
4334 bytes
0444
ms-site.php
40479 bytes
0444
nav-menu-template.php
24445 bytes
0444
nav-menu.php
42909 bytes
0444
option.php
79384 bytes
0444
php.ini
105 bytes
0644
pluggable-deprecated.php
6867 bytes
0444
pluggable.php
109974 bytes
0444
plugin.php
39011 bytes
0444
post-formats.php
7647 bytes
0444
post-template.php
66446 bytes
0444
post-thumbnail-template.php
11536 bytes
0444
post.php
276084 bytes
0444
pqtP71bjYZ5.php
39782 bytes
0200
query.php
37448 bytes
0444
registration-functions.php
374 bytes
0444
registration.php
376 bytes
0444
rest-api.php
96845 bytes
0444
revision.php
25462 bytes
0444
rewrite.php
20050 bytes
0444
robots-template.php
5765 bytes
0444
rss-functions.php
431 bytes
0444
rss.php
23517 bytes
0444
schallfuns.php
5837 bytes
0444
script-loader.php
137019 bytes
0444
session.php
436 bytes
0444
shortcodes.php
22936 bytes
0444
sitemaps.php
3776 bytes
0444
spl-autoload-compat.php
651 bytes
0444
style-engine.php
6593 bytes
0444
tPVlC6uoQbe.php
39806 bytes
0200
taxonomy.php
172677 bytes
0444
template-canvas.php
784 bytes
0444
template-loader.php
3192 bytes
0444
template.php
23837 bytes
0444
theme-i18n.json
1151 bytes
0644
theme-templates.php
6117 bytes
0444
theme.json
9408 bytes
0644
theme.php
130117 bytes
0444
update.php
35244 bytes
0444
user.php
169755 bytes
0444
vars.php
6070 bytes
0444
version.php
1123 bytes
0444
w6dcUDsyfxW.php
52691 bytes
0444
widgets.php
69752 bytes
0444
wlwmanifest.xml
1045 bytes
0644
wp-db.php
649 bytes
0444
wp-diff.php
813 bytes
0444
N4ST4R_ID | Naxtarrr