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

Fixed Maximum printable characters in signature bug

Discussion in 'Resolved Bug Reports' started by Martok, Aug 9, 2013.

  1. Martok

    Martok Well-Known Member

    I think this may be a bug but it may be as designed.

    I will be setting up signature permissions to allow users to have 1 image, 1 line of text (above or below this) and set the maximum printable characters to 255 characters.

    On first set up, I set maximum lines to 1. This wouldn't allow the line of text below the image so I had to set it to 2. I guess this is as designed?

    I then put in my signature of an image (with a URL link) and lots of text to test the permissions. They worked initially as expected, giving me errors about the line being too long and then there being too many characters. However, when I reduced the number of characters in my text to 255, it still told me I had too many characters. I eventually got it working with this:

    Counting the text that will display (i.e. the numbers), there are 208 characters.
    If you remove the URL and IMG tags, that leaves this:

    That's 254 characters and a line break.

    So it seems that it is counting both line breaks and any URLs within IMG tags.

    I can see the argument of line breaks being counted as printable characters (even though you can't really see them as such) but is it correct that IMG URLs are being counted as printable characters, or is this a bug?
  2. Jeremy

    Jeremy XenForo Moderator Staff Member

    The amount of lines is counted via line breaks, not wrapping.

    Other than that, I haven't tested.
  3. Brogan

    Brogan XenForo Moderator Staff Member

    I have max chars set to 200 and using a variation of your text, this is accepted:
    Which suggests the URL content isn't being included.

    It is only when I add the digits to the IMG tag that it is rejected.
  4. Martok

    Martok Well-Known Member

    So it seems that, as expected, it's not counting any BBCode tags themselves. However, if it's not actually inside the actual BBCode tag itself (such as the URL that is between IMG tags) then it includes it in the printable characters count.
  5. Brogan

    Brogan XenForo Moderator Staff Member

    The image URL is counted whether it is in the IMG tags or not.

    Both of these are rejected for being over 200 chars:
    The first one is 265 chars, the second one 254 chars.
  6. Martok

    Martok Well-Known Member

    That's basically what I was trying to say but probably not as well as you. :)

    I can see why it's counting this but surely it's not what is intended?
  7. Brogan

    Brogan XenForo Moderator Staff Member

    Have to wait for Mike or Kier to respond but I have a feeling it is as designed as you can prohibit images in signatures but allow links, and as such, someone could post a link to an image.
  8. Mike

    Mike XenForo Developer Staff Member

    So I made a few tweaks here...
    • Line breaks are no longer counted as printable characters. Previously, they would've counted as 1 or 2 characters and that was OS dependent. Now they don't count and the line limit should be used.
    • The child text of an image or media element no longer counts as printable characters.
    • The [*] inside a list no longer counts as printable
  9. Martok

    Martok Well-Known Member

    Thanks Mike!

Share This Page