Closed (fixed)
Project:
Drupal core
Version:
x.y.z
Component:
statistics.module
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
13 Feb 2006 at 17:56 UTC
Updated:
24 Mar 2006 at 18:01 UTC
Jump to comment: Most recent file
Comments
Comment #1
Bèr Kessels commentedComment #2
Steven commentedThis is impossible: l() always calls check_url() on the $path after it is passed through url(). Something very fishy is going on. Most likely url() is not seeing the referrer as an external URL.
Comment #3
markus_petrux commentedI believe the problem is this line in function url():
For referrers (or any other full url), the first condition (searching for ':') would be true, but the second condition would fail if there are, for instance, ampersands (common in many referrers, specially those coming from search engines).
Comment #4
markus_petrux commentedChaging the status because the patch won't work for the reason described by Steven.
Comment #5
morbus iffI'm not sure we should be passing full external URLs to l() or url() anyways - their docs and code suggest they only care about internal URLs, aliases, and paths. That seems to be the brunt of the problem - it's fiddling too much with something it shouldn't be fiddling with.
Comment #6
chx commentedthen the docs is out of date. l and url now does external.
Comment #7
morbus iffadmin/logs/referrers continues to work for me, on external links, with GET params. This means one of two things. Either
'<a href="'. check_url($referrer->url) .'">'is the right answer for this bug, or admin/logs/referrers is doing something wrong.Comment #8
morbus iffIncidentally, how does removing BASE break external URLs? Yes, this is a bug, but I fail to
see how BASE would have any effect whatsoever on URL encoding in url() or l().
Comment #9
drewish commentedsee also: http://drupal.org/node/45064
Comment #10
dopry commentedbump... so did anyone figure out what was going on here? does ber's patch work or not?
Is this even a valid bug? Can anyone who's using statistics reproduce?
Comment #11
Bèr Kessels commentedThis patch makes the node tracker similar to teh default tracker: with a hardcoded A tag (yuk!).
* Its more consistent
* It seems the shortest way to a solution (as opposed to rewriting the check_url bits and pieces)
Bèr
Comment #12
Bèr Kessels commentedbut I did have my coffee.. really!
Comment #13
morbus iffThis is the way I would do it too - the proper fix is faar too convoluted, IMO, for 4.7, and involves rewriting the internals of url() to check for GET parameters in the $path (when it expects those in $query). The current patch makes the behavior the same as on admin/logs/referrers (see also comment #7). Setting RTBC - once committed, we should reset this to active, so that we remember to work on url() for 4.8 with stronger absolute URL support, and static files (such that you can create .css and image links without having ?q= appended).
Comment #14
markus_petrux commentedIMHO, code needs work, reasons:
1) the patch has removed the column width check.
2) the referrer is render in other places, each with its own method. lack of consistency.
I'll try to roll a patch that fixes those issues.
Comment #15
morbus iffErm. The column width checker is still there, and the referrer is now using the same approach as admin/logs/referrers. What exactly are you working on?
Comment #16
morbus iffComment #17
markus_petrux commentedMorbus, you're right. The width check is present in the patch. I was confused because it isn't present in another place where the referrer is printed.
I have created a wrapper function, so the referrer is printed the same way everywhere. Feel free to discard, if the approach is not correct.
Comment #18
morbus iffI'm fine with this approach. Berkes?
Comment #19
Bèr Kessels commentedwhat is that
return ' ';good for?Comment #20
dries commentedSometimes we do want to show the complete URL. Sometimes (in table views) we only want to show part of the URL.
Making all code use the width check is not advised imo.
Comment #21
dopry commented+1 for Ber's last patch... it fixes the problem...
Comment #22
morbus iffDries, if that's the case, then the patch in #12 is RTBC.
Comment #23
Bèr Kessels commentedAllthough I think markus was heading the right way, I think fixing things that ain't really broekn should be done after 4.7.
My patch, the one in #12, is by far the simplest solution. Let us commit this and work on the other ten critical issues!
Comment #24
markus_petrux commentedAlthough I agree #12 is good to do... let me try another version that specifies a greater width for the log access details table.
The
is motivated by a comment in the "Empty Cells in a Table" section of this page:http://www.w3schools.com/html/html_tables.asp
Comment #25
Steven commentedAnd here's a patch which actually addresses the problem's source rather than adding in yet another ugly hack...
-1 on the original.
Comment #26
markus_petrux commented+1 for that.
Comment #27
Bèr Kessels commentedTested Stevens patch.
It does what it says it does: fix this issue!
It also seems to work with fake XSS referrers, in that way, that they are stripped.
+1
Ber
Comment #28
Steven commentedCommited to HEAD.
Comment #29
Zen commentedComment #30
(not verified) commented