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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jpwarren00’s picture

Patch renamed to include issue number.

quicksketch’s picture

if another subsystem moves a file to a server behind a CDN and updates the filepath to the remote location

Remote locations, afaik, aren't supported in any way in Drupal 6. Using a URL in the files table is not intended functionality.

jpwarren00’s picture

I 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.

quicksketch’s picture

Title: Need support for remote filepaths » Provide support for remote filepaths
Status: Active » Fixed

Hm, 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.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.