Skip to content
Snippets Groups Projects
Commit 7aeda574 authored by Andreas Gohr's avatar Andreas Gohr
Browse files

added proxy exception regexp FS#1247

parent 57e71d49
No related branches found
No related tags found
No related merge requests found
......@@ -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 */
......
......@@ -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;
......
......@@ -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';
......
......@@ -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');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment