Skip to content

Commit

Permalink
fix(iframe-block): add a trailing slash to iframe URL (#906)
Browse files Browse the repository at this point in the history
without the trailing slash, the iframe URL do a redirection to add the slash and set the request on
http which raise a mixed content issue, adding the trailing slash would stop the redirection and
minimize the calls to the server
  • Loading branch information
kariae authored Nov 16, 2021
1 parent c8528fc commit e4b7b7d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ private function process_iframe_archive( $request, $iframe_folder, $media_path )
// check if iframe entry file is there.
if ( file_exists( path_join( $iframe_path, self::IFRAME_ENTRY_FILE ) ) ) {
$response = [
'src' => $wp_upload_dir['url'] . self::IFRAME_UPLOAD_DIR . $iframe_folder,
'src' => $wp_upload_dir['url'] . self::IFRAME_UPLOAD_DIR . $iframe_folder . DIRECTORY_SEPARATOR,
'dir' => path_join( $wp_upload_dir['subdir'] . self::IFRAME_UPLOAD_DIR, $iframe_folder ),
];

Expand All @@ -186,7 +186,7 @@ function( $file ) {

if ( 1 === count( $archive_folders ) && file_exists( path_join( $archive_folders[0], self::IFRAME_ENTRY_FILE ) ) ) {
$response = [
'src' => $wp_upload_dir['url'] . self::IFRAME_UPLOAD_DIR . $iframe_folder . DIRECTORY_SEPARATOR . basename( $archive_folders[0] ),
'src' => $wp_upload_dir['url'] . self::IFRAME_UPLOAD_DIR . $iframe_folder . DIRECTORY_SEPARATOR . basename( $archive_folders[0] ) . DIRECTORY_SEPARATOR,
'dir' => path_join( $wp_upload_dir['subdir'] . self::IFRAME_UPLOAD_DIR, $iframe_folder . DIRECTORY_SEPARATOR ),
];

Expand Down

0 comments on commit e4b7b7d

Please sign in to comment.