added proxy exception regexp FS#1247

This commit is contained in:
Andreas Gohr 2010-06-26 20:42:48 +02:00
parent 57e71d49bb
commit 7aeda57486
4 changed files with 21 additions and 16 deletions

View File

@ -142,11 +142,12 @@ $conf['target']['media'] = '';
$conf['target']['windows'] = '';
//Proxy setup - if your Server needs a proxy to access the web set these
$conf['proxy']['host'] = '';
$conf['proxy']['port'] = '';
$conf['proxy']['user'] = '';
$conf['proxy']['pass'] = '';
$conf['proxy']['ssl'] = 0;
$conf['proxy']['host'] = '';
$conf['proxy']['port'] = '';
$conf['proxy']['user'] = '';
$conf['proxy']['pass'] = '';
$conf['proxy']['ssl'] = 0;
$conf['proxy']['except'] = '';
/* Safemode Hack */

View File

@ -29,11 +29,12 @@ class DokuHTTPClient extends HTTPClient {
$this->HTTPClient();
// set some values from the config
$this->proxy_host = $conf['proxy']['host'];
$this->proxy_port = $conf['proxy']['port'];
$this->proxy_user = $conf['proxy']['user'];
$this->proxy_pass = conf_decodeString($conf['proxy']['pass']);
$this->proxy_ssl = $conf['proxy']['ssl'];
$this->proxy_host = $conf['proxy']['host'];
$this->proxy_port = $conf['proxy']['port'];
$this->proxy_user = $conf['proxy']['user'];
$this->proxy_pass = conf_decodeString($conf['proxy']['pass']);
$this->proxy_ssl = $conf['proxy']['ssl'];
$this->proxy_except = $conf['proxy']['except'];
}
@ -105,6 +106,7 @@ class HTTPClient {
var $proxy_user;
var $proxy_pass;
var $proxy_ssl; //boolean set to true if your proxy needs SSL
var $proxy_except; // regexp of URLs to exclude from proxy
// what we use as boundary on multipart/form-data posts
var $boundary = '---DokuWikiHTTPClient--4523452351';
@ -202,7 +204,7 @@ class HTTPClient {
if(isset($uri['pass'])) $this->pass = $uri['pass'];
// proxy setup
if($this->proxy_host){
if($this->proxy_host && (!$this->proxy_except || !preg_match('/'.$this->proxy_except.'/i',$url)) ){
$request_url = $url;
$server = $this->proxy_host;
$port = $this->proxy_port;

View File

@ -157,11 +157,12 @@ $lang['target____media'] = 'Target window for media links';
$lang['target____windows'] = 'Target window for windows links';
/* Proxy Options */
$lang['proxy____host'] = 'Proxy servername';
$lang['proxy____port'] = 'Proxy port';
$lang['proxy____user'] = 'Proxy user name';
$lang['proxy____pass'] = 'Proxy password';
$lang['proxy____ssl'] = 'Use ssl to connect to Proxy';
$lang['proxy____host'] = 'Proxy servername';
$lang['proxy____port'] = 'Proxy port';
$lang['proxy____user'] = 'Proxy user name';
$lang['proxy____pass'] = 'Proxy password';
$lang['proxy____ssl'] = 'Use SLL to connect to proxy';
$lang['proxy____except'] = 'Regular expression to match URLs for which the proxy should be skipped for.';
/* Safemode Hack */
$lang['safemodehack'] = 'Enable safemode hack';

View File

@ -197,6 +197,7 @@ $meta['proxy____port'] = array('numericopt');
$meta['proxy____user'] = array('string');
$meta['proxy____pass'] = array('password','_code' => 'base64');
$meta['proxy____ssl'] = array('onoff');
$meta['proxy____except'] = array('string');
$meta['safemodehack'] = array('onoff');
$meta['ftp____host'] = array('string','_pattern' => '#^(|[a-z0-9\-\.+]+)$#i');
$meta['ftp____port'] = array('numericopt');