Wedge
Public area => The Pub => Bug reports => Topic started by: Arantor on March 1st, 2012, 05:55 PM
-
To clarify: preparsecode will do some operations to any bbcode to sanitise it (like strip 'html' bbcode from non admins), but it will also do expansions on things like /me and reformat certain URL type bbcodes to use full URLs.
This is a particularly tricky situation - because while a signature may be shorter than the limit, by the time it's preparsed it will may well go over the limit - and it may prevent subsequent saves to the signature too (if for example a URL is expanded, and it goes from limit - 1 to over the limit, you won't be able to save that signature even unchanged), and that's before we get into the realms of dealing with the line breaks becoming br tags.
What we might have to do is move the preparsecode before the length test, but proceed to flatten line breaks to a single character for the purposes of fairness.
-
Hmm... How about we simply count bbcode as a single character or something? Anything between [] could be ignored, for instance. (As long as it's a recognized bbc tag of course...)
-
It seems a touch prone to abuse, partly because it means images and links can be spammed in ways not normally possible.
-
If people want to limit the number of images in a signature, a size limit isn't gonna cut it -- after all they can use shortlinks. They'd rather see a limitation in the number of tags, then... Or better, a limitation in the number of links, images and media items. Why not... Then again, there are also people who like ensuring their signatures are, at the same time, as short and compact as possible, and as informative as they want them to be -- i.e. a list of links inside small icons, like your own sig.
-
And most of the reason is to keep it inside the sig limit, I'd have used the site names if I had room...
-
If you need it, just ask for it... :^^;: Or do it yourself, I think you have admin access..?
So... I'm not sure about the best solution for this. I'd just rather keep it simple.
-
That particular page is proper admin settings, which I don't have. Besides, there is something quite *nice* about having limits to work within, brings out the optimiser in me.
The best solution, really, to this problem says to me that a rethink of "what the aim of sig bbc options is there for" might be necessary.
What purpose is it trying to solve?
Well, it's trying to solve signature abuse with mashups of horrendous markup.
What purpose does the signature length have?
It prevents people from having obscenely large signatures.
In that respect, the setup is mostly fine as it is, that it's not the intent that's at fault, but the execution. But there's a side effect to the signature length - it also limits how many links and so on.
Do we want to limit the number of links that can be in a signature? Or number of images?
Could be interesting but it's also a can of worms because that implies things like per-group settings. (Though, having regular members/moderators/admins as divisions seems quite sane to me. But even then I can imagine sites wanting to give out 'extra links' as a premium member perk)
Would/should we get rid of bbc choices?
I'm inclined to leave it alone, for one reason: it does prevent people making lists and tables in signatures if the admin so chooses, which can be good from a formatting point of view.
-
There's an interesting suggestion been made, that the preparsing essentially should happen twice.
What I'm thinking it might be simpler to do is perform the expansions that would normally occur, then do validation on length, so not quite full preparsing. Mind you, it does depend a lot on the comments about, about what signatures 'need'.
-
Well if someone complains about that then they have no life.
(does it show that I'm pissed off right now? :P)
-
ohh...that would make sense...
}
preparsecode($value);
// Too long?
if (!allowedTo('admin_forum') && !empty($sig_limits[1]) && $smcFunc['strlen'](str_replace('<br />', "\n", $value)) > $sig_limits[1])
{
$_POST['signature'] = trim(htmlspecialchars(str_replace('<br />', "\n", $value), ENT_QUOTES));
$txt['profile_error_signature_max_length'] = sprintf($txt['profile_error_signature_max_length'], $sig_limits[1]);
return 'signature_max_length';
}
return true;
} Not even necessary to shorten it (javascript will take care of this aspect :P).
Missing a check for the admin somewhere.
-
Not even necessary to shorten it (javascript will take care of this aspect :P).
What if they have JS off?
-
The JS is used simply to handle shortening in the user-editing area, if it's off, things should still get truncated regardless.
-
Hey emanuele, since I see you're online -- hope you didn't miss my SMF/Wedge bug fix related to this feature ;) (i.e. a regex was missing the 'global' modifier and as a result it incorrectly calculated the size.)
-
:hmm:
/medid miss it.../megoes to lunch :angel: and later he will look at the code.Thanks! :D
-
No problem. I told you to look at our changelogs :P
-
Our changelogs don't just have SMF bug fixes in though and it can be easy to miss 'em.
-
I'm positive that I specified it's a SMF bug. (ie everytime I fix a bug, I check the SMF 2.0 codebase to see if it's there too. If it is, I specify it in the changelog so that the SMF team can fix it as well.)
-
No problem. I told you to look at our changelogs :P
It's in my todo list, but I'm still at page 75 because I read soooo slowly... :(
-
Now what is it we always tell newbies? :P :lol:
(Remember that search can also work on a single topic ;))
-
Hmm, I never heard that one. I must of never been a newbie. :niark:
-
The quick search defaults based on where you are - if you're in a topic, it defaults to that topic, if you're in a board - default to that board, otherwise search the whole forum.
-
The quick search defaults based on where you are - if you're in a topic, it defaults to that topic, if you're in a board - default to that board, otherwise search the whole forum.
That automatically thinking for a user might be a pain though. What if I want to search the entire forums for something while I am in the post.
I haven't done much searching here so I haven't notice the search behavior. I can see myself if I didn't know this information like "WTF, the search isn't searching right" lol.
But I was referring to the saying. :D
-
That's SMF's behaviour, we have not touched it ;)
-
Yup, touched nothing... ;)
However, Noisen and a few others (sm.org :P) allow you to define your scope manually with a select box. It's just something that's been in my to-do list for so long (and so easy to do!) that I'm wondering whether I'll actually THINK of implementing it here... :lol:
-
I think the scope aspect is a pretty neat idea and have no idea why it wasn't introduced into the core by default. Note that while there is a mod for it, it is modified in sm.org's case and I'd love to see making that at least a little extensible ;)
-
Now what is it we always tell newbies? :P :lol:
(Remember that search can also work on a single topic ;))
But I want to read, is the funny part... :D
P.S.
10!
-
Funny? I'd rather you say stunning :P
-
Funny? I'd rather you say stunning :P
Ahahah :D