Closed (outdated)
Project:
@font-your-face
Version:
6.x-2.x-dev
Component:
Fontdeck (provider)
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
31 May 2012 at 19:39 UTC
Updated:
8 Aug 2020 at 14:11 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
sreynen commentedThanks for the report and the patch. A few issues:
1) Let's fix the 7.x branch first, then backport.
2) Patches should be made following the instructions at http://drupal.org/patch/create
3) Rather than setting the value of $domain, then returning, I think we can skip a step and return the result of the preg_replace() directly.
Comment #2
aidanlis commentedI don't have time to play patch tennis, so do with it what you will :)
Comment #3
Drave Robber commentedHere's it against 7.x-2.x-dev, with the following changes:
Comment #4
sreynen commentedThis isn't working for me. Specifically,
parse_url($_SERVER['HTTP_HOST'], PHP_URL_HOST)is returning FALSE, I think because$_SERVER['HTTP_HOST']is only host, not a full URL.$host = parse_url('http://' . $_SERVER['HTTP_HOST'], PHP_URL_HOST);works for me. That feels a bit hackish, but I don't have any better ideas.Comment #5
Drave Robber commentedAccording to docs,
...but sometimes the best is just not enough.
As the whole purpose of this was to strip port numbers, it could as well read:
$host = parse_url($_SERVER['HTTP_HOST'], PHP_URL_PORT) > 0 ? parse_url($_SERVER['HTTP_HOST'], PHP_URL_HOST) : $_SERVER['HTTP_HOST'];I did a couple of quick tests, strings like
localhost:666and127.0.0.1:666are parsed correctly.Comment #6
Drave Robber commentedOr, for slightly shorter lines and to avoid calling parse_url() twice:
Comment #7
sreynen commentedI did some more testing to try to figure out where parse_url() breaks down. It looks like it works consistently with a host and a port, but always fails with just the host. So I think #6 will work, though I'd change the
isset($details['port'])toisset($details['host']). If it somehow did parse the host without a port, I think we'd still want the parsed host.Comment #8
Drave Robber commentedImplements #6 + #7, plus adds a somewhat verbose comment on what all this means.
Comment #9
sreynen commentedCommitted.
Comment #10
Drave Robber commented#8 needs backporting to D6.
Comment #11
sreynen commentedTagging.
Comment #12
Drave Robber commentedThis may become obsolete when #1891820: fontdeck_get_domain() - stripping www is not necessary and #1894072: Protocol relative URLs for Fontdeck are resolved.
Comment #13
neslee canil pinto