Commit bdb705e2 authored by Joe Hoyle's avatar Joe Hoyle
Browse files

Ability to disable the URLs being rewrittd to the s3 bucket

This is useful if you are proxying uploads with something like nginx to s3
parent 7a85fbc8
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -43,8 +43,11 @@ class S3_Uploads {

		$dirs['path'] = str_replace( WP_CONTENT_DIR, 's3://' . $this->bucket, $dirs['path'] );
		$dirs['basedir'] = str_replace( WP_CONTENT_DIR, 's3://' . $this->bucket, $dirs['basedir'] );

		if ( ! defined( 'S3_UPLOADS_DISABLE_REPLACE_UPLOAD_URL' ) || ! S3_UPLOADS_DISABLE_REPLACE_UPLOAD_URL ) {
			$dirs['url'] = str_replace( WP_CONTENT_URL, $this->get_s3_url(), $dirs['url'] );
			$dirs['baseurl'] = str_replace( WP_CONTENT_URL, $this->get_s3_url(), $dirs['baseurl'] );
		}

		return $dirs;
	}