don't require a port-declaration in validating an URL when an IP address is given, fixes #1179

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2013-04-23 15:58:03 +02:00
parent f2d10046b6
commit 7a69cf73ba
2 changed files with 5 additions and 2 deletions

View File

@@ -58,7 +58,10 @@ function validateUrl($url) {
$ip = substr($ip, 0, strpos($ip, '/'));
// possible : in IP (when a port is given), #1173
$ip = substr($ip, 0, strpos($ip, ':'));
// but only if there actually IS ONE
if (strpos($ip, ':') !== false) {
$ip = substr($ip, 0, strpos($ip, ':'));
}
if (validate_ip($ip, true) !== false) {
return true;