summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYury German <blueknight@gentoo.org>2022-06-15 12:08:35 -0400
committerYury German <blueknight@gentoo.org>2022-06-15 12:08:35 -0400
commit36d7691c33cb64ece817246e47a779ec648d10b0 (patch)
tree08f2fb95303a1d8eeba2c8629a24b35a91fb1cac /plugins/jetpack/modules/shortcodes.php
parenttwentyfourteen upg 2.7 to 3.2 and twentysixteen from 2.0 to 2.5 (diff)
downloadblogs-gentoo-36d7691c33cb64ece817246e47a779ec648d10b0.tar.gz
blogs-gentoo-36d7691c33cb64ece817246e47a779ec648d10b0.tar.bz2
blogs-gentoo-36d7691c33cb64ece817246e47a779ec648d10b0.zip
Openid-3.6.1 and jetpack-11.0 upgrade
Signed-off-by: Yury German <blueknight@gentoo.org>
Diffstat (limited to 'plugins/jetpack/modules/shortcodes.php')
-rw-r--r--plugins/jetpack/modules/shortcodes.php14
1 files changed, 10 insertions, 4 deletions
diff --git a/plugins/jetpack/modules/shortcodes.php b/plugins/jetpack/modules/shortcodes.php
index 39e18d49..cb77ca92 100644
--- a/plugins/jetpack/modules/shortcodes.php
+++ b/plugins/jetpack/modules/shortcodes.php
@@ -1,5 +1,4 @@
<?php
-
/**
* Module Name: Shortcode Embeds
* Module Description: Shortcodes are WordPress-specific markup that let you add media from popular sites. This feature is no longer necessary as the editor now handles media embeds rather gracefully.
@@ -10,7 +9,9 @@
* Auto Activate: No
* Module Tags: Photos and Videos, Social, Writing, Appearance
* Feature: Writing
- * Additional Search Queries: shortcodes, shortcode, embeds, media, bandcamp, dailymotion, facebook, flickr, google calendars, google maps, google+, polldaddy, recipe, recipes, scribd, slideshare, slideshow, slideshows, soundcloud, ted, twitter, vimeo, vine, youtube
+ * Additional Search Queries: shortcodes, shortcode, embeds, media, bandcamp, dailymotion, facebook, flickr, google calendars, google maps, polldaddy, recipe, recipes, scribd, slideshare, slideshow, slideshows, soundcloud, ted, twitter, vimeo, vine, youtube
+ *
+ * @package automattic/jetpack
*/
/**
@@ -47,7 +48,7 @@ function shortcode_new_to_old_params( $params, $old_format_support = false ) {
function jetpack_load_shortcodes() {
$shortcode_includes = array();
- foreach ( Jetpack::glob_php( dirname( __FILE__ ) . '/shortcodes' ) as $file ) {
+ foreach ( Jetpack::glob_php( __DIR__ . '/shortcodes' ) as $file ) {
$filename = substr( basename( $file ), 0, -4 );
$shortcode_includes[ $filename ] = $file;
@@ -178,7 +179,7 @@ function wpcom_shortcodereverse_parseattr( $attrs ) {
$attrs = shortcode_atts( $defaults, $attrs );
- $attrs['src'] = strip_tags( $attrs['src'] ); // For sanity
+ $attrs['src'] = wp_strip_all_tags( $attrs['src'] ); // For sanity.
$attrs['width'] = ( is_numeric( $attrs['width'] ) ) ? abs( (int) $attrs['width'] ) : $defaults['width'];
$attrs['height'] = ( is_numeric( $attrs['height'] ) ) ? abs( (int) $attrs['height'] ) : $defaults['height'];
@@ -188,6 +189,11 @@ function wpcom_shortcodereverse_parseattr( $attrs ) {
/**
* When an embed service goes away, we can use this handler
* to output a link for history's sake.
+ *
+ * @param array $matches Regex partial matches against the URL passed.
+ * @param array $attr Attributes received in embed response.
+ * @param string $url Requested URL to be embedded.
+ * @return string Link to output.
*/
function jetpack_deprecated_embed_handler( $matches, $attr, $url ) {
return sprintf( '<a href="%s">%s</a>', esc_url( $url ), esc_html( esc_url( $url ) ) );