From b1608ae860d8b72d56916c08fdf78ca2135a08db Mon Sep 17 00:00:00 2001
From: Andreas Fischer <bantu@phpbb.com>
Date: Thu, 14 Jul 2011 02:09:22 +0200
Subject: [PATCH] [ticket/10267] Call strlen() on $table_prefix for $max_length
 calculation.

PHPBB3-10267
---
 phpBB/includes/db/db_tools.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/phpBB/includes/db/db_tools.php b/phpBB/includes/db/db_tools.php
index 50e308dea2..d23323a5b1 100644
--- a/phpBB/includes/db/db_tools.php
+++ b/phpBB/includes/db/db_tools.php
@@ -2059,7 +2059,7 @@ class phpbb_db_tools
 		$table_prefix = substr(CONFIG_TABLE, 0, -6); // strlen(config)
 		if (strlen($table_name . $index_name) - strlen($table_prefix) > 24)
 		{
-			$max_length = $table_prefix + 24;
+			$max_length = strlen($table_prefix) + 24;
 			trigger_error("Index name '{$table_name}_$index_name' on table '$table_name' is too long. The maximum is $max_length characters.", E_USER_ERROR);
 		}
 
@@ -2096,7 +2096,7 @@ class phpbb_db_tools
 		$table_prefix = substr(CONFIG_TABLE, 0, -6); // strlen(config)
 		if (strlen($table_name . $index_name) - strlen($table_prefix) > 24)
 		{
-			$max_length = $table_prefix + 24;
+			$max_length = strlen($table_prefix) + 24;
 			trigger_error("Index name '{$table_name}_$index_name' on table '$table_name' is too long. The maximum is $max_length characters.", E_USER_ERROR);
 		}