From 9aa55fb94c5fdb364d1f19bb38a6027ef62a81cb Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Sun, 18 Nov 2001 15:36:56 +0000 Subject: Slightly fairer sig length check, removes =.*? from BBCode and HTML tags git-svn-id: file:///svn/phpbb/trunk@1360 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/profile.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/phpBB/profile.php b/phpBB/profile.php index d715d7d9b3..828c485960 100644 --- a/phpBB/profile.php +++ b/phpBB/profile.php @@ -631,7 +631,16 @@ if( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) ) if( $signature != "" ) { - if( strlen($signature) > $board_config['max_sig_chars'] ) + $sig_length_check = preg_replace("/(\[.*?)(=.*?)\]/is", "\\1]", $signature); + if( $allowhtml ) + { + $sig_length_check = preg_replace("/(<.*?)(=.*?)([ \/]?" . ">)/is", "\\1\\3", $signature); + } + + $signature_bbcode_uid = ( $allowbbcode ) ? make_bbcode_uid() : ""; + $signature = prepare_message($signature, $allowhtml, $allowbbcode, $allowsmilies, $signature_bbcode_uid); + + if( strlen($sig_length_check) > $board_config['max_sig_chars'] ) { $error = TRUE; if( isset($error_msg) ) @@ -640,11 +649,6 @@ if( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) ) } $error_msg .= $lang['Signature_too_long']; } - else - { - $signature_bbcode_uid = ( $allowbbcode ) ? make_bbcode_uid() : ""; - $signature = prepare_message($signature, $allowhtml, $allowbbcode, $allowsmilies, $signature_bbcode_uid); - } } if( $mode == "register" ) -- cgit v1.2.1