1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

As Designed Possible thread title bug?

Discussion in 'Resolved Bug Reports' started by Rudy, Jan 28, 2011.

  1. Rudy

    Rudy Well-Known Member

    I was trying to post a song title in quotes in one of my threads, and the first word ended up being lowercase. I have set XF to make thread titles have each word capitalized. My thread title is:

    Shootout: "Yeh Yeh"

    ...but it is coming out as:

    Shootout: "yeh Yeh" .

    I have checked it and tried to correct it a few times, but I think the quote character is being considered the first "letter" in the word, as it keeps hopping back to the second version after I submit my thread edits.

    Either that, or my "allnighter" last night is catching up to me... ;)
     
  2. Kier

    Kier XenForo Developer Staff Member

    This is just the way ucwords() works in PHP - it's a pretty extreme edge case so it's really not worth spending the effort to roll our own version for these rare occasions when a non-alphanumeric character is used as the thread title start.
     
  3. Rudy

    Rudy Well-Known Member

    That's odd that ucwords() would consider punctuation to be a valid character--I would argue it's a bug in PHP. I wasn't sure if you were using ucwords() or were doing it your own way. I just peeked at php.net/ucwords, and there are all sorts of comments about other ways to to it (and most of them are quite sloppy coding IMHO). Best to leave it alone, I would think.

    I am going to end up disabling it since there are acronyms which get changed also. PHP becomes Php. ;) A lot of our dicussions involve acronyms. My main issue is that I'm very particular about grammar, and want to avoid those small handfuls of members who write their titles all in lowercase...

    Thanks Kier!
     
  4. Cezz

    Cezz Well-Known Member

    This is more of an annoyance than a bug, but when you enable Automatically Adjust Case t0 Title case it doesn't capitalise the first letter in a word but the first character, what I mean by this is that if you add quotations or any other punctuation at the beginning of a word the first letter is automatically forced to lowercase with no way of overwriting this looks very weird.

    An example Title
    Would get changed to
    --------------

    Another Example is
    Would get change to
    Now I haven't really looked into how the Automatic adjusting works and if it is simply using a function that is part of Zend but it seems like it should ignore this sort of punctuation and only capitalise the first letter of Words...
     
  5. Brogan

    Brogan XenForo Moderator Staff Member

  6. Cezz

    Cezz Well-Known Member

    Ahhhh thanks Brogan, did try searching and didn't find anything... lucky this feature isn't turned on here though or the [Duplicate] tag you added to the title would actually become [duplicate] :p

    Any chance this thread could be merged with the dupe? So that my additional examples would be included!
     
  7. Brogan

    Brogan XenForo Moderator Staff Member

    Done :)
     
    Cezz likes this.
  8. brendanc

    brendanc Active Member

    If I may be so bold as to suggest you might have some luck using CSS to fix your capitalization woes?
    text-transform:capitalize; can capitalize all the words in whatever selector you want, so you could do:

    .titleBar h1 { text-transform:capitalize; }

    And I believe that will accomplish what you want without changing anything on XenForo's side.
     

Share This Page