SMF Development > Bug Reports

MWAHAHAHA! I found one!

(1/3) > >>

Antechinus:
Applies to 1.1.x and 2.0.x and 2.1 alpha. Hey, at least we're consistent, right. ;)

Anyway, although personal text has a 50 character limit on it, for some reason the custom title has never had any limit. You can just keep merrily typing in characters until your database freaks. This seems to not be a good thing, since IMO the custom title should be short and sweet, given it's location. Fix is easy.

1.1.x - Profile.template.php

Find:
--- Code: --- <td><input type="text" name="usertitle" size="50" value="' . $context['member']['title'] . '" /></td>
--- End code ---

Replace:
--- Code: --- <td><input type="text" name="usertitle" size="50" maxlength="50" value="' . $context['member']['title'] . '" /></td>
--- End code ---

2.0.x and 2.1 Alpha - Profile-Modify.php

Find:
--- Code: --- 'usertitle' => array(
'type' => 'text',
'label' => $txt['custom_title'],
'log_change' => true,
--- End code ---

Replace:
--- Code: --- 'usertitle' => array(
'type' => 'text',
'label' => $txt['custom_title'],
'log_change' => true,
'input_attr' => array('maxlength="50"'),
--- End code ---

Personally I'd be inclined to restrict the title to 32 characters, but whatever. 50 is consistent with the current input size.

Colin:
LOL, how did you even find that :). Good one though.

IchBin™:
Should be limited at the database table though. It's a varchar(255). But yes, I agree that it could be limited at the frontend like that. But more importantly cut it off in the source.

Antechinus:
Oh I was testing new theme ideas for 2.1 alpha, and played around with the custom title while testing to see how layout might possibly break. Went "WTF?" when I realised the custom title could just keep going ad infinitum.

Actually it may have a 256 character limit, depending on the type of db field it is. Haven't looked at that, but fixing it in Sources makes sense anyway.

Ok, well we can change the db field too if that's preferable. I was just fixing my own site since I was tired of the occasional wally posting a bloody sonnet up there. :D

ETA: Actually it may be better to leave the limit in the files. More accessible for some people, if they want to change it, and all the others are limited in the arrays anyway.

emanuele:
And let's not forget the related one: http://dev.simplemachines.org/mantis/view.php?id=4919 :P

Navigation

[0] Message Index

[#] Next page

Go to full version