Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
contact.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
4 Mar 2008 at 04:23 UTC
Updated:
2 Jan 2014 at 23:45 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dave reidSeems valid. Marking to the current version of Drupal to patch then backport.
Comment #2
dave reidPatch ready for review.
Comment #4
dave reidMy bad.
Comment #5
j.somers commentedPatch works fine for me.
Comment #6
dawehneri tested the patch also and it works well.
i'm just wondering why using "<" instead of "<" does not work, can someone explain this?
Comment #7
dropcube commentedSimple patch, confirming RTBC.
Comment #8
webchickLooks good. Committed to HEAD. Thanks! Moving back to 6.x for consideration.
@dereine: We use < because this is output to the browser, and we're required to encode entities or else we break XHTML compliance.
Comment #9
gábor hojtsyDid not apply to Drupal 6, but rerolled and committed.
I'd like to point out however that the page title is still the user's account name, not the real name even if theme_username() is overriden in other places. Since the theme function generates links if the user can view profiles, this cannot be used directly to set the page title (unless we want the page title to have a link of course).
Comment #10
webchickHm. Good point.
Moving back to 7.x, since we can at least fix this here. Also tagging as novice, since I imagine this is probably easy to fix. :) http://api.drupal.org/api/function/contact_user_page/7 looks like a good place to start; else maybe by adding a 'title callback' to the menu item like 'user/%user_uid_optional' has.
Comment #11
wulff commentedI wonder if we could simply use filter_xss or something similar to strip the <a> tags from the return value of theme_username?
Comment #12
dixon_I've tested the patch in #11 and it works fine on a fresh D7 installation.
I still don't know if this is the preferred way to approach the problem. But this feels like a simpler solution than adding a title callback to the menu item. Am I right?
Comment #13
webchickHm. I think this will end up with
<a href="...">showing up in your<title>tags. I've asked Peter to take a look at this as well, since he's more well-versed in the D7 version of drupal_set_title().Comment #14
webchickComment #15
pwolanin commentedusing filter_xss() will certainly be safe if that's the goal. By passing in no allowed tags, it will effectively strip all tags, plus do some other checks.
In fact, we will also run it through strip_tags() in http://api.drupal.org/api/function/template_preprocess_page/7 for the head title so the worry is not really that tags will end up in the
<title>tag.Comment #16
pwolanin commentedProbably this is fine for now - however, we should possibly as a separate patch add a parameter to theme_username to request the non-link form.
Comment #17
webchickHm. So when I actually tried this patch out myself, I found it a bit jarring.
I overrode the theme_username() function like so:
user/1/view: page title is "a"
user/1/edit: page title is "a"
user/1/tracker: page title is "a"
user/1/contact: page title is "bananas"
I'm thinking we'll want to escalate this to a larger "we should use the username coming out of theme_username() in user/X/Y" issue since fixing it only in Contact module looks very bizarre.
I've created a separate issue here for this: #464888: Use theme('username') in user profile page titles. I'm going to mark this issue fixed because the patch back in #4 was committed, but hopefully we can get some resolution over there for the larger user profile mis-match issue.