[Plugin: Relocate Upload] not work with HTTPS
-
Hello,
I found it does not work with HTTPS.
I made a patch for relocate-upload.php to work with HTTPS.
It seems to work well with WordPress 3.0.1.Please consider about the patch.
Regards.--- relocate-upload.php.orig 2010-10-11 20:06:04.000000000 +0900 +++ relocate-upload.php 2010-10-11 20:30:11.000000000 +0900 @@ -92,7 +92,11 @@ { jQuery($element).attr({disabled: true}); jQuery($element).siblings("span").html(' Moving...'); jQuery.get( - "<?php echo WP_CONTENT_URL."/plugins/relocate-upload/relocate-upload.php"; ?>", + "<?php + $content_url = ( empty($_SERVER['HTTPS']) ) + ? WP_CONTENT_URL + : str_replace( "https://", "https://", WP_CONTENT_URL ); + echo $content_url."/plugins/relocate-upload/relocate-upload.php"; ?>", { ru_folder: $element.selectedIndex, id: $element.getAttribute('media_id'), _wpnonce: '<?php echo wp_create_nonce("ru_request_move") ?>', @@ -292,6 +296,6 @@ add_filter( 'wp_get_attachment_url', "wp_get_attachment_url_absolute_path_fix"); -function wp_get_attachment_url_absolute_path_fix($url) { return preg_replace('#(https://.*?/).*?/'.(SERVER_DOC_ROOT).'/#','\1',$url); } +function wp_get_attachment_url_absolute_path_fix($url) { return preg_replace('#(https?://.*?/).*?/'.(SERVER_DOC_ROOT).'/#','\1',$url); } ?>
- The topic ‘[Plugin: Relocate Upload] not work with HTTPS’ is closed to new replies.