Postponed
Project:
Persistent URL
Version:
6.x-1.0-beta10
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
23 Mar 2010 at 10:05 UTC
Updated:
2 Jul 2010 at 15:33 UTC
If you use the same value for subdomain as domain, the detector will misunderstand it as subdomain: for example you use localhost for subdomain modifier value, then when you run http://localhost the PURL will detect the domain as subdomain and all urls are rewrote to http://localhost.localhost and mess the whole site up.
Maybe this one will fix the problem
function detect($q) {
$parts = explode('.', str_replace('http://','',$_SERVER['HTTP_HOST']));
if (count($parts) <= 2) {
return null;
}
return array_shift($parts);
}
Comments
Comment #1
yhahn commentedHm, so a fix for this is not trivial. Looking into the problem space, we need to be able to determine what is a proper top level domain and what is not (see https://wiki.mozilla.org/TLD_List).
Comment #2
nquocbao commentedor maybe we just ignore this bug, consider it as "known issues". PURL should work as fast as possible ?
Comment #3
jmiccolis commentedI'm in the "known issue" camp here. I'm quite sure there is a much much much smarter way we could represent URIs inside of PURL that would make solving these sorts of issues moot. However sure it'll be a lot of work, and I'm not sure it's worth the effort for 95% of use cases.
Setting this to postponed, for now, we should revisit this later when we get the time to revisit PURL's internals.