[Agavi-Users] Regex problem with IPv6 on request/AgaviWebRequest.class.php

9 views
Skip to first unread message

Simon Cornelius P Umacob

unread,
Mar 16, 2012, 4:23:54 AM3/16/12
to us...@lists.agavi.org
Houmenta!

I'm testing our web app with IPv6 right now, and I seem to have some
problems with $this->getResponse()->setRedirect(). Upon closer
inspection, it looks like the problem is in
AgaviWebRequest::initialize():

$SERVER_NAME = self::getSourceValue($sources['SERVER_NAME'],
$sourceDefaults['SERVER_NAME']);
$port = $this->getUrlPort();
if(preg_match_all('/\:/', $SERVER_NAME, $m) > 1) {
$this->urlHost = preg_replace('/\]\:' . preg_quote($port,
'/') . '$/', '', $SERVER_NAME);
} else {
$this->urlHost = preg_replace('/\:' . preg_quote($port,
'/') . '$/', '', $SERVER_NAME);
}

var_dump($this->urlHost);

Output:

string(16) "https://[2001:0/"


Cheers,

[ simon.cpu ]

_______________________________________________
users mailing list
us...@lists.agavi.org
http://lists.agavi.org/mailman/listinfo/users

Simon Cornelius P Umacob

unread,
Mar 16, 2012, 4:27:04 AM3/16/12
to us...@lists.agavi.org
Weird, my $_SERVER["SERVER_NAME"] contains "[2001"... We're using lighttpd:

# lighttpd -v
lighttpd/1.4.30 (ssl) - a light and fast webserver
Build-Date: Mar 9 2012 13:26:25

Simon Cornelius P Umacob

unread,
Mar 16, 2012, 4:30:04 AM3/16/12
to us...@lists.agavi.org
Never mind... It turns out that I reported this bug to lighttpd months ago...

http://redmine.lighttpd.net/issues/2333

On Fri, Mar 16, 2012 at 4:27 PM, Simon Cornelius P Umacob

Reply all
Reply to author
Forward
0 new messages