Skip to:

Opened 11 years ago

Closed 11 years ago

#573 closed defect (fixed)

Install breaks when domain is localhost

Reported by: mdawaffe Owned by:
Milestone: 0.8 Priority: normal
Severity: normal Version: 0.8
Component: API - Installation/Upgrade Keywords:


Regex assumes the domain looks like something.somethingelse.

We probably don't need those checks.

Patch attached.

Attachments (1)

573.diff (1.7 KB) - added by mdawaffe 11 years ago.

Download all attachments as: .zip

Change History (4)

11 years ago

#1 @sambauers
11 years ago

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, "" does, as does ""

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 and your wordpress domain name is it tests them by comparing whether "" matches "".

This seems a bit dodgy as down here where I am and in other parts of the word we have domain names like, so if we do a similar test we are checking "" matches "". So the test will potentially not return an error when it should, like if your bbpress domain name is and your wordpress domain name is, by the looks of things it will match "" to "" 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.

#2 @mdawaffe
11 years ago

Good point about :)

It's not really a huge deal, though. If someone tries to set it up badly and their cookies don't work, that's ok. I think it's more worthwhile to improve the documentation than it is to improve these sanity checks.

#3 @mdawaffe
11 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [697]) so1o uncoverd something that 'should essentially never happen' :). Fixes #573

Note: See TracTickets for help on using tickets.