mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Secure embeds in the editor (first run):
- When the user pastes an embeddable http URL, try to get the https embed. - If an embed provider doesn't support ssl embeds, show a placeholder/error message. - Revise the way we return error messages. See #28195, #28507. git-svn-id: https://develop.svn.wordpress.org/trunk@28919 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -12,6 +12,12 @@ class WP_Embed {
|
||||
public $usecache = true;
|
||||
public $linkifunknown = true;
|
||||
|
||||
/**
|
||||
* When an URL cannot be embedded, return false instead of returning a link
|
||||
* or the URL. Bypasses the 'embed_maybe_make_link' filter.
|
||||
*/
|
||||
public $return_false_on_fail = false;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
@@ -322,6 +328,10 @@ class WP_Embed {
|
||||
* @return string Linked URL or the original URL.
|
||||
*/
|
||||
public function maybe_make_link( $url ) {
|
||||
if ( $this->return_false_on_fail ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$output = ( $this->linkifunknown ) ? '<a href="' . esc_url($url) . '">' . esc_html($url) . '</a>' : $url;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user