Skip to:
Content

Opened 7 years ago

Closed 7 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: Installation/Upgrade Keywords:
Cc:

Description

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 7 years ago.

Download all attachments as: .zip

Change History (4)

mdawaffe7 years ago

comment:1 sambauers7 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, "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.

comment:2 mdawaffe7 years ago

Good point about .org.au :)

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.

comment:3 mdawaffe7 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.