Illegal listen_url for legal domain name
my listen url is http://10.ladio.me:8000/ and i got the following error in icecast error.log
[2009-10-15 13:30:42] EROR yp/send_to_yp YP add on http://dir.xiph.org/cgi-bin/yp-cgi failed: Add refused. Reason: Illegal listen_url. Incorrect <hostname>.
i've checked xiph.org svn source
<?php
$listen_url = "http://10.ladio.me:8000/";
$url = @parse_url($listen_url);
var_dump($url);
var_dump(empty($url['scheme']), $url['scheme'] != 'http'
,!array_key_exists('host', $url)
,!preg_match('/^.*[A-Za-z0-9\-]+\.[A-Za-z0-9]+$/', $url['host'])
,preg_match('/^(10\.|192\.168\.|127\.)/', $url['host']));
got
bool(false)
bool(false)
bool(false)
bool(false)
int(1)
preg_match('/^(10\.|192\.168\.|127\.)/', $url['host'])
is returning int(1), yes 10.ladio.me loos like 10.0.0.1, but it's not IP anyway
imho, the regex code should be changed to
preg_match('/^(10\.|192\.168\.|127\.)[0-9.]+$/', $url['host'])
, and this is quirk and simple