Skip to content

Commit

Permalink
Fix error when entering correct proxy URLs with ports and proxy schemas
Browse files Browse the repository at this point in the history
Entering correct proxy URLS with ports and one of the following schemas
(tcp, udp, unix, udg, ssl, tls) would cause an error (Invalid format given)
even though these proxies are correct.

Now this issue is resolved and the proxies URLs are valid again.
  • Loading branch information
loocars committed Aug 14, 2024
1 parent 32d7884 commit 0cf6d10
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
1.9.43
Core:
* FIX: Fix error when entering correct proxy URLs with ports and proxy schemas.
Entering correct proxy URLS with ports and one of the following schemas
(tcp, udp, unix, udg, ssl, tls) would cause an error (Invalid format given)
even though these proxies are correct.

1.9.42
Security:
Expand Down
2 changes: 1 addition & 1 deletion share/server/core/classes/GlobalMainCfg.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public function __construct() {
'http_proxy' => array(
'must' => 0,
'default' => null,
'match' => MATCH_STRING_URL,
'match' => MATCH_STRING_PROXY,
),
'http_proxy_auth' => array(
'must' => 0,
Expand Down
7 changes: 5 additions & 2 deletions share/server/core/defines/matches.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@
define('MATCH_STRING_PATH', '/^[0-9a-z\s_.\-\/\\\]+$/i');
define('MATCH_STRING_PATH_AUTHORISATION', '/^(?!' . DISALLOWED_AUTHORISATION_PATHS . ')[0-9a-z\s_.\-\/\\\]+$/i');
define('MATCH_ALLOWED_URL_SCHEMES', '(http|https)');
define('MATCH_STRING_URL', '/^(?:' . MATCH_ALLOWED_URL_SCHEMES . ':)?[0-9a-z\s;|+[\]()=%?&_,.\-#@=\/\\\~\{\}]+$/i');
define('MATCH_STRING_URL_EMPTY', '/^(?:' . MATCH_ALLOWED_URL_SCHEMES . ':)?[0-9a-z\s;|+[\]()=%?&_,.\-#@=\/\\\~]*$/i');
define('MATCH_ALLOWED_PROXY_SCHEMES', '(tcp|udp|unix|udg|ssl|tls)');
define('MATCH_PORT', '(?::[0-9]+)?');
define('MATCH_STRING_PROXY', '/^(?:' . MATCH_ALLOWED_PROXY_SCHEMES . ':)?[0-9a-z\s;|+[\]()=%?&_,.\-#@=\/\\\~\{\}:]+' . MATCH_PORT . '$/i');
define('MATCH_STRING_URL', '/^(?:' . MATCH_ALLOWED_URL_SCHEMES . ':)?[0-9a-z\s;|+[\]()=%?&_,.\-#@=\/\\\~\{\}:]+' . MATCH_PORT . '$/i');
define('MATCH_STRING_URL_EMPTY', '/^(?:' . MATCH_ALLOWED_URL_SCHEMES . ':)?[0-9a-z\s;|+[\]()=%?&_,.\-#@=\/\\\~:]*' . MATCH_PORT . '$/i');
define('MATCH_GADGET_OPT', '/^[0-9a-z\s:+[\]()_.,\-&?!#@=\/\\\%]+$/i');
define('MATCH_STRING_STYLE', '/^[0-9a-z:;\-+%#(),.]*$/i');
define('MATCH_COORDS', '/^(?:(?:[0-9]+)|([a-z0-9]+(?:%[+-][0-9]+)?))$/');
Expand Down

0 comments on commit 0cf6d10

Please sign in to comment.