[Bb-trac] Re: [bbPress] #573: Install breaks when domain is localhost

bbPress bb-trac at lists.bbpress.org
Thu Feb 8 05:41:56 GMT 2007


#573: Install breaks when domain is localhost
----------------------------------+-----------------------------------------
 Reporter:  mdawaffe              |        Owner:      
     Type:  defect                |       Status:  new 
 Priority:  normal                |    Milestone:  0.80
Component:  Installation/Upgrade  |      Version:  0.80
 Severity:  normal                |   Resolution:      
 Keywords:                        |  
----------------------------------+-----------------------------------------
Comment (by sambauers):

 Repeated here from my post to the mailing list:

 The regexp wants there to be at least one period (.) in there.
 {{{
 (.*\.)?([^.]+\.[^.]+)
 }}}
 Break it up into parts
 {{{
 (           ;-- start subpattern
    .*       <-- 0 or more of any character
    \.       <-- exactly one period
 )?          <-- end subpattern (match 0 or 1 of this subpattern)

 (           <-- start subpattern
    [^.]+    <-- 1 or more of any character that is not a period
    \.       <-- exactly one period
    [^.]+    <-- 1 or more of any character that is not a period
 )           <-- end subpattern (match 1 of this subpattern)
 }}}
 "localhost" does not satisfy this pattern, "four.three.two.one" does, as
 does "two.one"

 Looking at that code, the next bit of logic compares the bbpress domain to
 the wordpress domain to test for cookie sharing, but it appears to only
 test the last two parts of the domain names. IE if your bbpress domain
 name is www.example.org and your wordpress domain name is www.example.org
 it tests them by comparing whether "example.org" matches "example.org".

 This seems a bit dodgy as down here where I am and in other parts of the
 word we have domain names like www.example.org.au, so if we do a similar
 test we are checking "org.au" matches "org.au". So the test will
 potentially not return an error when it should, like if your bbpress
 domain name is www.example.org.au and your wordpress domain name is
 www.another.org.au, by the looks of things it will match "org.au" to
 "org.au" and keep you blissfully unaware that the integration won't work.

 I can't suggest a better test because I'm not sure of the implications it
 may have to later setting of the cookies domain.

-- 
Ticket URL: <http://trac.bbpress.org/ticket/573#comment:1>
bbPress <http://bbpress.org/>
Innovative forum development


More information about the Bb-trac mailing list