[ticket/10640] Do not change default value of truncate_string()

The default value should be kept, so we do not change the behaviour for MODs
and Extensions that use the function with its default values.

PHPBB3-10640
This commit is contained in:
Joas Schilling 2012-05-02 13:13:20 +02:00 committed by Michael Cullum
parent 53d8464776
commit a259db7105
2 changed files with 3 additions and 3 deletions

View file

@ -1107,7 +1107,7 @@ function extension_allowed($forum_id, $extension, &$extensions)
* NOTE: This parameter can cause undesired behavior (returning strings longer than $max_store_length) and is deprecated. * NOTE: This parameter can cause undesired behavior (returning strings longer than $max_store_length) and is deprecated.
* @param string $append String to be appended * @param string $append String to be appended
*/ */
function truncate_string($string, $max_length = 120, $max_store_length = 255, $allow_reply = false, $append = '') function truncate_string($string, $max_length = 60, $max_store_length = 255, $allow_reply = false, $append = '')
{ {
$chars = array(); $chars = array();

View file

@ -1657,8 +1657,8 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
// First of all make sure the subject and topic title are having the correct length. // First of all make sure the subject and topic title are having the correct length.
// To achieve this without cutting off between special chars we convert to an array and then count the elements. // To achieve this without cutting off between special chars we convert to an array and then count the elements.
$subject = truncate_string($subject); $subject = truncate_string($subject, 120);
$data['topic_title'] = truncate_string($data['topic_title']); $data['topic_title'] = truncate_string($data['topic_title'], 120);
// Collect some basic information about which tables and which rows to update/insert // Collect some basic information about which tables and which rows to update/insert
$sql_data = $topic_row = array(); $sql_data = $topic_row = array();