Commit 8ba1f1d9 authored by Joe Hoyle's avatar Joe Hoyle
Browse files

Only upload image to s3 if it's in the content dir

parent 4b4ad52f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ class S3_Uploads_Uploader {
	 */
	public function upload_file_to_s3( $file_path ) {

		$relative = str_replace( WP_CONTENT_DIR, '', $file_path );
		$relative = str_replace( WP_CONTENT_DIR . '/', '', $file_path );

		try {
			$this->s3()->putObject(array(
+1 −1
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ class S3_Uploads_WordPress_Uploads_Uploader extends S3_Uploads_Uploader {
	 */
	public function filter_upload_attachment( $file, $attachment_id ) {

		if ( ! file_exists( $file ) )
		if ( ! file_exists( $file ) || strpos( $file, WP_CONTENT_DIR ) !== 0 )
			return $file;

		$relative = str_replace( WP_CONTENT_DIR, '', $file );