It's Possible to have 250-Lined Signatures

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Suggested Hosts
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
Locked
Luiji
Registered User
Posts: 2
Joined: Wed Feb 24, 2010 9:42 pm

It's Possible to have 250-Lined Signatures

Post by Luiji » Mon Mar 29, 2010 11:24 pm

I can't figure out how to report bugs on this website, so I hope this is the right place.

It is possible for users to create signatures that have 250 lines of just one letter. I've done this as a test, and it really makes the forum messed up. (It was fun, though. :mrgreen:)

Suggestion: Put a limit to the number of newline characters to, I don't know, 5?

Comkid
Registered User
Posts: 132
Joined: Thu Mar 25, 2010 5:40 am

Re: It's Possible to have 250-Lined Signatures

Post by Comkid » Tue Mar 30, 2010 12:13 am

That would be pretty simple, in the part where it processes the signature all you'd need to do is:

OPEN: includes/functions.php

FIND:

Code: Select all

function request_var($var_name, $default, $multibyte = false, $cookie = false) 
REPLACE WITH:

Code: Select all

function request_var($var_name, $default, $multibyte = false, $cookie = false, $line_limit = 0) 
FIND:

Code: Select all

set_var($var, $var, $type, $multibyte); 
REPLACE WITH:

Code: Select all

if ($line_limit !== 0)
        {
            $var_lines = substr_count($var, "\n");
            if ($var_lines > $line_limit)
            {
                return $default;
            }
        }
        else
        {
            set_var($var, $var, $type, $multibyte);
        } 
OPEN: includes/ucp/ucp_profile.php

FIND:

Code: Select all

$signature        = utf8_normalize_nfc(request_var('signature', (string) $user->data['user_sig'], true)); 
REPLACE WITH:

Code: Select all

$signature        = utf8_normalize_nfc(request_var('signature', (string) $user->data['user_sig'], true, false, 4)); 
FIND:

Code: Select all

add_form_key('ucp_sig');

                if ($submit || $preview)
                { 
ADD AFTER:

Code: Select all

if ($signature == $user->data['user_sig'])
                    {
                        $message = 'You have used too many lines in your signature, your signature has now been reverted to the previous signature' . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
                        trigger_error($message);
                    } 
Last edited by Comkid on Tue Mar 30, 2010 2:39 am, edited 1 time in total.
I ist Comkid :P

User avatar
ric323
Former Team Member
Posts: 22909
Joined: Tue Feb 06, 2007 12:33 am
Location: Melbourne, Australia
Name: Ric
Contact:

Re: It's Possible to have 250-Lined Signatures

Post by ric323 » Tue Mar 30, 2010 2:39 am

Luiji wrote:I can't figure out how to report bugs on this website, so I hope this is the right place.
Bug tracker
It is possible for users to create signatures that have 250 lines of just one letter. I've done this as a test, and it really makes the forum messed up. (It was fun, though. :mrgreen:)
It's not a "bug". We don't choose to automatically limit every possible anti-social thing a user might try to do, but you would earn a very swift warning from a moderator here if you left it like that!
The Knowledge Base contains solutions to many common problems!
How to fix "Doesn't have a default value" and "Incorrect string value: xxx for column 'post_text' " errors.
How to do a clean re-install of the latest phpBB3 version.
Problems with permissions? Read phpBB3 Permissions

User avatar
Lumpy Burgertushie
Registered User
Posts: 66328
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: It's Possible to have 250-Lined Signatures

Post by Lumpy Burgertushie » Tue Mar 30, 2010 4:58 am

plus you can set how many characters a sig can have from the admin panel.

that would stop what you are talking about very easily.

robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

Comkid
Registered User
Posts: 132
Joined: Thu Mar 25, 2010 5:40 am

Re: It's Possible to have 250-Lined Signatures

Post by Comkid » Tue Mar 30, 2010 5:19 am

No but it is possible to use around 50 characters to make a 50 line signature ;) And if you make it too small it'd be too hard to use those characters just to make a one liner that you normally use
I ist Comkid :P

Locked

Return to “[3.0.x] Support Forum”