I found out that you can go above 500 characters in your signature for one edit. I had an urge to see if you could just remove part of a Simple Machines url and see if it worked like any url. It's temporary though, leaving you with having to redo some stuff. It has to be a Simple Machines forum (or the forum you are on) url though.
- Copy a Simple Machines page url, such as http://www.simplemachines.org/community/index.php?topic=topicid.0 (this link doesn't work by the way)
- Delete the http://www.simplemachines.org/community/index.php, leaving you with '?topic=topicid.0'.
- When you click the link, you'll see that it still works.
That's because it adds back in http://www.simplemachines.org/community/index.php into your signature, BUT it doesn't delete any of the extra at the end, leaving you with an extended signature. (if you edit your sig again, you'll see the extra text is already deleted, but that doesn't mean it's gone (until you update again as it is))
I did do a search on this board about this and didn't find it.
Hi RayRay26!
Thanks for the report.
Could you please explain what do you mean with "the extra at the end"? (a screenshot would be useful)
/me sometime is completely blind...or simply doesn't read everything... :P
Now I got it.
Yes, I think it can be considered a bug.
then can you report it?
Looking into this.
The simplest way to fix it I can think of is to...preparse it twice...
// Too long?
if (!empty($sig_limits[1]) && $smcFunc['strlen']($unparsed_signature) > $sig_limits[1])
{
$_POST['signature'] = trim(htmlspecialchars($smcFunc['substr']($unparsed_signature, 0, $sig_limits[1]), ENT_QUOTES));
// Lenght is something particular...unfortunately...
$unparsed_signature_length = $unparsed_signature;
preparsecode($unparsed_signature_length);
$unparsed_signature_length = str_replace('<br />', "\n", $unparsed_signature_length);
// Too long?
if (!empty($sig_limits[1]) && $smcFunc['strlen']($unparsed_signature_length) > $sig_limits[1])
{
$_POST['signature'] = trim(htmlspecialchars($smcFunc['substr']($unparsed_signature_length, 0, $sig_limits[1]), ENT_QUOTES));
I'm wondering if it is worth.
Opinions?
Not sure if this is a bug or a tip / trick
Seems like a pretty narrow case, if I'm reading it right, where it has to be a forum link that SMF knows to 'fix' the link to cause the overflow on the save. I don't think its worth the fix, especially since its a bit ugly :D
Let's say there are other cases (like /me and most likely img in certain conditions, etc.).
Yes, the fix workaround is a bit ugly.
Much cleaner version:
}
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;
}
moved the length check at the end (not shortened because there is javascript client side that will do).
Yup ... much cleaner :)
Speaking of which, I have always found pretty annoying the javascript that cuts out the last bit of the signature when is too long.
Wouldn't be much nicer and less destructive a red border around the box and an error box at the top?