aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2012-05-02 13:13:20 +0200
committerMichael Cullum <unknownbliss@phpbbdevelopers.net>2012-06-17 19:07:17 +0100
commita259db71058cd20eb54ac3b45a88b558c66e4cb5 (patch)
tree07473f8c1b393c9689319b0041c9c83897c53845
parent53d846477665ea6b8a3463318f03050282aec89a (diff)
downloadforums-a259db71058cd20eb54ac3b45a88b558c66e4cb5.tar
forums-a259db71058cd20eb54ac3b45a88b558c66e4cb5.tar.gz
forums-a259db71058cd20eb54ac3b45a88b558c66e4cb5.tar.bz2
forums-a259db71058cd20eb54ac3b45a88b558c66e4cb5.tar.xz
forums-a259db71058cd20eb54ac3b45a88b558c66e4cb5.zip
[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
-rw-r--r--phpBB/includes/functions_content.php2
-rw-r--r--phpBB/includes/functions_posting.php4
2 files changed, 3 insertions, 3 deletions
diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php
index 752ebe0f13..6b2ee98d7a 100644
--- a/phpBB/includes/functions_content.php
+++ b/phpBB/includes/functions_content.php
@@ -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.
* @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();
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index f77f54679f..c549f99091 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -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.
// To achieve this without cutting off between special chars we convert to an array and then count the elements.
- $subject = truncate_string($subject);
- $data['topic_title'] = truncate_string($data['topic_title']);
+ $subject = truncate_string($subject, 120);
+ $data['topic_title'] = truncate_string($data['topic_title'], 120);
// Collect some basic information about which tables and which rows to update/insert
$sql_data = $topic_row = array();