From: Tim Starling Date: Tue, 29 Jun 2010 03:49:35 +0000 (+0000) Subject: Let CookieJar work for hostnames without dots in them, so that ApiTest can work on... X-Git-Tag: 1.31.0-rc.0~36353 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/supprimer.php?a=commitdiff_plain;h=6784f598b690a160d14a0ea5521106db94d941f0;p=lhc%2Fweb%2Fwiklou.git Let CookieJar work for hostnames without dots in them, so that ApiTest can work on my test wiki (and presumably most other localhost wikis). --- diff --git a/includes/HttpFunctions.php b/includes/HttpFunctions.php index 1dc9859648..3f571cfabb 100644 --- a/includes/HttpFunctions.php +++ b/includes/HttpFunctions.php @@ -560,9 +560,6 @@ class Cookie { $dc = explode(".", $domain); - // Don't allow cookies for "localhost", "ls" or other dot-less hosts - if( count($dc) < 2 ) return false; - // Only allow full, valid IP addresses if( preg_match( '/^[0-9.]+$/', $domain ) ) { if( count( $dc ) != 4 ) return false; @@ -707,7 +704,6 @@ class CookieJar { } elseif ( !Cookie::validateCookieDomain( $attr['domain'], $domain ) ) { return null; } - $this->setCookie( $name, $value, $attr ); } }