enable-media-replace icon indicating copy to clipboard operation
enable-media-replace copied to clipboard

Plugin does not work with stream wrappers for media held off the filesystem.

Open philipowen opened this issue 8 years ago • 3 comments

We us an Amazon S3 storage plugin that stores all the media in an S3 bucket. This means that the files are referred to as s3://bucket/folder/file. Line 206 of upload.php is doing a replace on double forward slashes to convert to a single one, which breaks the protocol handler detection and causes the plugin to fail. Commenting out that line makes the plugin work correctly for files of the format protocol://foo/bar.

I'm happy to put a PR up, but wanted to know the best way to address this. It isn't obvious to me what case that replace is covering, but it is clearly there for a reason. Would it be okay to only run that replace where the // isn't preceded by a :? Or is there some better logic?

Many thanks.

philipowen avatar Aug 14 '17 14:08 philipowen

I am evaluating this plugin for our site and we, too, use S3 (via the humanmade S3-Upload plugin). Any word on a fix for this?

tomtoday avatar Mar 02 '18 15:03 tomtoday

You can try the fix that I used but I was hoping to hear something here before creating a PR.

philipowen avatar Mar 02 '18 15:03 philipowen

Thanks! I'll give that a try.

FWIW, I am very impressed with the frequency at which @mansj updates this code. I appreciate your work and effort.

tomtoday avatar Mar 02 '18 16:03 tomtoday