r68705 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68704‎ | r68705 | r68706 >
Date:03:49, 29 June 2010
Author:tstarling
Status:ok (Comments)
Tags:
Comment:
Let CookieJar work for hostnames without dots in them, so that ApiTest can work on my test wiki (and presumably most other localhost wikis).
Modified paths:
  • /trunk/phase3/includes/HttpFunctions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/HttpFunctions.php
@@ -560,9 +560,6 @@
561561
562562 $dc = explode(".", $domain);
563563
564 - // Don't allow cookies for "localhost", "ls" or other dot-less hosts
565 - if( count($dc) < 2 ) return false;
566 -
567564 // Only allow full, valid IP addresses
568565 if( preg_match( '/^[0-9.]+$/', $domain ) ) {
569566 if( count( $dc ) != 4 ) return false;
@@ -707,7 +704,6 @@
708705 } elseif ( !Cookie::validateCookieDomain( $attr['domain'], $domain ) ) {
709706 return null;
710707 }
711 -
712708 $this->setCookie( $name, $value, $attr );
713709 }
714710 }

Comments

#Comment by MZMcBride (talk | contribs)   04:15, 2 July 2010

Looks like the localhost check was added in r62118. I'm not sure of the virtue of such a check, but I can say that it looks like there's still a maintenance test for it in /trunk/phase3/maintenance/tests/HttpTest.php.

Status & tagging log