mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
bye bye forbidden extensions... we have a deny,allow rule for extensions, forbidden extensions are therefore a little bit redundant.
git-svn-id: file:///svn/phpbb/trunk@4400 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
e46f4cb505
commit
c0551af851
6 changed files with 8 additions and 63 deletions
|
@ -250,23 +250,16 @@ if ($submit && $mode == 'extensions')
|
|||
{
|
||||
if (!count($error))
|
||||
{
|
||||
$extension_check = array(EXTENSIONS_TABLE => 'EXTENSION_EXIST', FORBIDDEN_EXTENSIONS_TABLE => 'CANNOT_ADD_FORBIDDEN_EXTENSION');
|
||||
|
||||
foreach ($extension_check as $table => $error_msg)
|
||||
{
|
||||
$sql = "SELECT extension
|
||||
FROM $table";
|
||||
$result = $db->sql_query($sql);
|
||||
$sql = 'SELECT extension_id
|
||||
FROM ' . EXTENSIONS_TABLE . "
|
||||
WHERE extension = '$add_extension'";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
if ($row['extension'] == $add_extension)
|
||||
{
|
||||
$error[] = sprintf($user->lang[$error_msg], $add_extension);
|
||||
}
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$error[] = sprintf($user->lang['EXTENSION_EXIST'], $add_extension);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if (!count($error))
|
||||
{
|
||||
|
|
|
@ -144,7 +144,6 @@ define('CONFIG_TABLE', $table_prefix.'config');
|
|||
define('CONFIRM_TABLE', $table_prefix.'confirm');
|
||||
define('DISALLOW_TABLE', $table_prefix.'disallow'); //
|
||||
define('EXTENSIONS_TABLE', $table_prefix.'extensions');
|
||||
define('FORBIDDEN_EXTENSIONS_TABLE', $table_prefix.'forbidden_extensions');
|
||||
define('EXTENSION_GROUPS_TABLE', $table_prefix.'extension_groups');
|
||||
define('FORUMS_TABLE', $table_prefix.'forums');
|
||||
define('FORUMS_TRACK_TABLE', $table_prefix.'forums_marking');
|
||||
|
|
|
@ -216,23 +216,6 @@ CREATE TRIGGER phpbb_extension_groups_trig
|
|||
NEW.group_id = GEN_ID(phpbb_extension_groups_gen, 1)|
|
||||
END;
|
||||
|
||||
# Table: 'phpbb_forbidden_extensions'
|
||||
CREATE TABLE phpbb_forbidden_extensions (
|
||||
extension_id INTEGER NOT NULL,
|
||||
extension VARCHAR(100) NOT NULL,
|
||||
PRIMARY KEY (extension_id)
|
||||
);
|
||||
|
||||
CREATE GENERATOR phpbb_forbidden_extensions_gen;
|
||||
SET GENERATOR phpbb_forbidden_extensions_gen TO 0;
|
||||
|
||||
CREATE TRIGGER phpbb_forbidden_extensions_trig
|
||||
FOR phpbb_forbidden_extensions BEFORE INSERT
|
||||
AS BEGIN
|
||||
IF (NEW.extension_id IS NULL) THEN
|
||||
NEW.extension_id = GEN_ID(phpbb_forbidden_extensions_gen, 1)|
|
||||
END;
|
||||
|
||||
# Table: 'phpbb_forums'
|
||||
CREATE TABLE phpbb_forums (
|
||||
forum_id SMALLINT NOT NULL,
|
||||
|
|
|
@ -141,13 +141,6 @@ CREATE TABLE phpbb_extension_groups (
|
|||
PRIMARY KEY (group_id)
|
||||
);
|
||||
|
||||
# Table: 'phpbb_forbidden_extensions'
|
||||
CREATE TABLE phpbb_forbidden_extensions (
|
||||
extension_id mediumint(8) UNSIGNED NOT NULL auto_increment,
|
||||
extension varchar(100) NOT NULL,
|
||||
PRIMARY KEY (extension_id)
|
||||
);
|
||||
|
||||
# Table: 'phpbb_forums'
|
||||
CREATE TABLE phpbb_forums (
|
||||
forum_id smallint(5) UNSIGNED NOT NULL auto_increment,
|
||||
|
|
|
@ -481,22 +481,6 @@ INSERT INTO phpbb_reports_reasons (reason_id, reason_priority, reason_name, reas
|
|||
|
||||
# MSSQL IDENTITY phpbb_reports_reasons OFF #
|
||||
|
||||
|
||||
# MSSQL IDENTITY phpbb_forbidden_extensions ON #
|
||||
|
||||
# -- forbidden_extensions
|
||||
INSERT INTO phpbb_forbidden_extensions (extension_id, extension) VALUES (1, 'php');
|
||||
INSERT INTO phpbb_forbidden_extensions (extension_id, extension) VALUES (2, 'php3');
|
||||
INSERT INTO phpbb_forbidden_extensions (extension_id, extension) VALUES (3, 'php4');
|
||||
INSERT INTO phpbb_forbidden_extensions (extension_id, extension) VALUES (4, 'phtml');
|
||||
INSERT INTO phpbb_forbidden_extensions (extension_id, extension) VALUES (5, 'pl');
|
||||
INSERT INTO phpbb_forbidden_extensions (extension_id, extension) VALUES (6, 'asp');
|
||||
INSERT INTO phpbb_forbidden_extensions (extension_id, extension) VALUES (7, 'cgi');
|
||||
INSERT INTO phpbb_forbidden_extensions (extension_id, extension) VALUES (8, 'aspx');
|
||||
|
||||
# MSSQL IDENTITY phpbb_forbidden_extensions OFF #
|
||||
|
||||
|
||||
# MSSQL IDENTITY phpbb_extension_groups ON #
|
||||
|
||||
# -- extension_groups
|
||||
|
|
|
@ -130,13 +130,6 @@ CREATE TABLE phpbb_extension_groups (
|
|||
PRIMARY KEY (group_id)
|
||||
);
|
||||
|
||||
-- Table: 'phpbb_forbidden_extensions'
|
||||
CREATE TABLE phpbb_forbidden_extensions (
|
||||
extension_id INTEGER NOT NULL,
|
||||
extension VARCHAR(100) NOT NULL,
|
||||
PRIMARY KEY (extension_id)
|
||||
);
|
||||
|
||||
-- Table: 'phpbb_forums'
|
||||
CREATE TABLE phpbb_forums (
|
||||
forum_id INTEGER NOT NULL,
|
||||
|
|
Loading…
Add table
Reference in a new issue