Needs work
Project:
Local image input filter
Version:
7.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
17 Aug 2012 at 18:47 UTC
Updated:
19 May 2016 at 14:18 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
MarkAgarunov commentedWrong patch attached to the first post, fixed patch is attached.
Comment #2
MGParisi commentedI will test this but can not easily run this patch. Can you include the entire .module file?
Comment #3
sunThis input filter is part of Drupal 8 core now. I would recommend to create feature request against Drupal 8 core.
Comment #4
christefano commentedPatch no longer applies.
Comment #5
dave reidIf at least we have a patch proposed for Drupal 8 but not committed, I think it would be ok to proceed with committing a patch here.
Comment #6
drummFor Drupal.org, we need a whitelist because:
$_SERVER['HTTP_HOST']isn't set.Comment #7
drummThis must have tests since it is security-related.
And there should be a patch for D8 with added tests that are passing, so this doesn't get out of line.
Comment #8
gregglesBasic raised a good point in #1952278-17: White list travis-ci.org as a valid source for external images that we should proxy these images and store them locally, temporarily, on behalf of other services. This gets around privacy and stability concerns about those images.
I think the implementation would be something like:
* the images are requested and copied to the local filesystem
* a variable determines how often to go get a new copy of the image
* if the request for the new image fails, the local copy is kept
Comment #9
sunHm... Not sure I agree with that.
Comment #10
basic commentedIf an external host is offline pages are not stuck waiting for a connection to the external host. The image cache should respect the cache headers sent by the image. Github uses this for images including travis-ci status. Images are loaded from https://camo.githubusercontent.com/. This also prevents tracking user data and browser data through external servers with all requests for images proxied at drupal.org.
Whitelisting is needed to move drupal.org to www.drupal.org, but I don't consider *.drupal.org external, not sure the download facility is required for that.
Comment #11
drummLet's limit the scope of this issue to whitelisting. We can decide to whitelist travis-ci, or a proxy setup, at #1952278: White list travis-ci.org as a valid source for external images.
Comment #12
drummComment #13
drumm#2257291: Handle alternate domains in filter_html_image_secure has a D8 patch. When that has a firm plan, this issue can proceed.
Comment #14
drumm#2257291: Handle alternate domains in filter_html_image_secure has barely enough feedback for the backport to proceed. Looks like #1 will be a good starting point.
Comment #16
drummI committed the filter code only for the backport. This is an advanced setting, and not providing a UI is okay.
Comment #17
sun@drumm: It is absolutely required for this to come with tests, because this is a security related feature/module.
Adding proper test coverage (once) also ensures that drupal.org works correctly (forever). ;)
Comment #18
m1r1k commentedHere is tests and some fixes
Comment #19
m1r1k commentedfilter_html_image_secire_process == MODULE_NAME_process == implementation of template_process(&$vars, $hook) that means that filter callback is invoked for ALL theme functions.
Allows to specify settings per format.
Comment #21
nick_vhGreat work!
Would be nicer if you take it out of the if. Towards drupal 8 this format will be a bit harder to use.
Comment #22
m1r1k commentedHere is patch with fix for CLI testing.
I'm using $base_url instead if $_SERVER['HTTP_HOST']
Comment #24
m1r1k commentedComment #28
jsobiecki commentedComment #29
hass commentedUninstall of variables is completly missing in this patches. Also in the one that has been committed.
Comment #30
hass commentedComment #31
hass commentedRe-uploading for re-test.
Comment #35
vinay15I have rerolled the patch.
Comment #37
vinay15Sorry, that's an incorrect patch.
Comment #38
vinay15