mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
- bbcode ids need to be greater than NUM_CORE_BBCODES
git-svn-id: file:///svn/phpbb/trunk@5672 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
5f6473fd54
commit
c272b05969
1 changed files with 8 additions and 15 deletions
|
@ -122,7 +122,7 @@ class acp_bbcodes
|
||||||
|
|
||||||
if ($action == 'create')
|
if ($action == 'create')
|
||||||
{
|
{
|
||||||
$sql = 'SELECT MAX(bbcode_id) as bbcode_id
|
$sql = 'SELECT MAX(bbcode_id) as max_bbcode_id
|
||||||
FROM ' . BBCODES_TABLE;
|
FROM ' . BBCODES_TABLE;
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
$row = $db->sql_fetchrow($result);
|
$row = $db->sql_fetchrow($result);
|
||||||
|
@ -130,24 +130,17 @@ class acp_bbcodes
|
||||||
|
|
||||||
if ($row)
|
if ($row)
|
||||||
{
|
{
|
||||||
$bbcode_id = $row['bbcode_id'] + 1;
|
$bbcode_id = $row['max_bbcode_id'] + 1;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$sql = 'SELECT MIN(bbcode_id) AS min_id, MAX(bbcode_id) AS max_id
|
|
||||||
FROM ' . BBCODES_TABLE;
|
|
||||||
$result = $db->sql_query($sql);
|
|
||||||
$row = $db->sql_fetchrow($result);
|
|
||||||
$db->sql_freeresult($result);
|
|
||||||
|
|
||||||
if (empty($row['min_id']) || $row['min_id'] >= NUM_CORE_BBCODES)
|
// Make sure it is greater than the core bbcode ids...
|
||||||
|
if ($bbcode_id <= NUM_CORE_BBCODES)
|
||||||
{
|
{
|
||||||
$bbcode_id = NUM_CORE_BBCODES + 1;
|
$bbcode_id = NUM_CORE_BBCODES + 1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$bbcode_id = $row['max_id'] + 1;
|
$bbcode_id = NUM_CORE_BBCODES + 1;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($bbcode_id > 31)
|
if ($bbcode_id > 31)
|
||||||
|
|
Loading…
Add table
Reference in a new issue