|
External Images, Remote Images, Munge Resources Help January 27, 2012 09:58AM |
Registered: 1 year ago Posts: 1 |
I am having the hardest time with MungeResources and the utilization of external images in a safe manner. I have been trying to figure for some time now, any help with this would be appreciated.
To clarify, I am looking to do this:
user inputs : img src='http://www.theirsite.com/headshot.gif'
and I want this to happen:
img src='http://img.mysite.com/img.php?p=http://www.theirsite.com/headshot.gif'
or something to that effect. What would be perfect is to automatically download it and store on my server.
img src='http://img.mysite.com/img.php?p=http://www.theirsite.com/headshot.gif'
That and the other problem is when I purifier the document, I could take the purified code and it fails the WC3 validation. Any help would be appreciated as this project is taking too long already.
Here is my setup:
require_once '../htmlpurifier-4-3lte/library/HTMLPurifier.auto.php';
$config = HTMLPurifier_Config::createDefault();
$config->set('Core.Encoding', 'UTF-8');
$config->set('HTML.Doctype', 'HTML 4.01 Transitional');
$config->set('HTML.TidyLevel', 'heavy');
$config->set('URI.Base', 'http://www.mysite.com');
$config->set('URI.MakeAbsolute', true);
$config->set('AutoFormat.AutoParagraph', true);
$config->set('URI.MungeResources', true);
$config->set('URI.Munge', 'http://www.google.com/url?q=%s');
$config->set('HTML.Allowed', 'u,p,b,i,p,strong,em,li,ul,ol,div[align],br,img,img[src],a,a[href]');
$config->set('AutoFormat.Linkify', true);
$purifier = new HTMLPurifier();
|
Re: External Images, Remote Images, Munge Resources Help January 27, 2012 07:28PM |
Admin Registered: 6 years ago Posts: 2,640 |