Currently if another subsystem moves a file to a server behind a CDN and updates the filepath to the remote location, filefield will fail to validate the system path and will prepend the default system filepath in front of the remote url resulting in a broken path. A conditional test for the http/s prefix on the filepath during the two path formatting calls in filefield_formatter.inc to skip the calls to file.inc allows filefield to play nice with these now remote files without interfering with the normal operation of filefield. This patch assumes that all path modification is happening on the back end and is not user input.
Comment | File | Size | Author |
---|---|---|---|
#1 | support_remote_filepaths-1491290-000000.patch | 1.15 KB | jpwarren00 |
support_remote_filepaths-000000-000000.patch | 1.15 KB | jpwarren00 |
Comments
Comment #1
jpwarren00 CreditAttribution: jpwarren00 commentedPatch renamed to include issue number.
Comment #2
quicksketchRemote locations, afaik, aren't supported in any way in Drupal 6. Using a URL in the files table is not intended functionality.
Comment #3
jpwarren00 CreditAttribution: jpwarren00 commentedI understand this, that is why I made it a feature request in this module to provide the additional functionality so the Drupal sites in my enterprise have an integrated solution for our existing enterprise file serving infrastructure. This is a very simple solution that doesn't interfere with any other filefield functionality, and retains the full flexibility of filefield and from what I can see is not exploitable by anyone who doesn't already have enough access and permissions to cause malice on a server (as in access to directly modifying database contents).
I'd prefer to push this patch through instead of having to fork and refactor filefield.
Comment #4
quicksketchHm, okay fair enough. The patch seems simple enough and unlikely to break any existing functionality. Obviously new releases of FileField aren't happening frequently, so it's probably too late to be helpful for you, but I've committed this patch to repository and it will be in the next version.