diff options
author | Jo Michael <me@mynetx.net> | 2012-03-16 23:14:27 +0400 |
---|---|---|
committer | Jo Michael <me@mynetx.net> | 2012-03-16 23:14:27 +0400 |
commit | 0326405d005fc4d938b2ad2fc9b6d7a7e498c0c4 (patch) | |
tree | 371ba6c2fc3ca8e3f8f7878f502d404c7a16dffc /import.php | |
parent | 5904800e03510dd5f6f210be703ef1805f3fb743 (diff) |
Don't rely on grab_globals for import.php
Diffstat (limited to 'import.php')
-rw-r--r-- | import.php | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/import.php b/import.php index 2ecd6a4a63..95561557a1 100644 --- a/import.php +++ b/import.php @@ -21,12 +21,20 @@ if (isset($_REQUEST['show_as_php'])) { */ $post_params = array( 'action_bookmark', + 'allow_interrupt', 'bkm_label', 'bookmark_variable', + 'charset_of_file', + 'format', 'id_bookmark', + 'import_type', 'is_js_confirmed', - 'message_to_show' + 'MAX_FILE_SIZE', + 'message_to_show', + 'noplugin', + 'skip_queries' ); + foreach ($post_params as $one_post_param) { if (isset($_POST[$one_post_param])) { $GLOBALS[$one_post_param] = $_POST[$one_post_param]; @@ -87,6 +95,23 @@ if ($_POST == array() && $_GET == array()) { include './libraries/footer.inc.php'; } +/** + * Sets globals from $_POST patterns, for import plugins + * We only need to load the selected plugin + */ + +$post_patterns = array( + '/^force_file_/', + '/^'. $format . '_/' +); +foreach (array_keys($_POST) as $post_key) { + foreach ($post_patterns as $one_post_pattern) { + if (preg_match($one_post_pattern, $post_key)) { + $GLOBALS[$post_key] = $_POST[$post_key]; + } + } +} + // Check needed parameters PMA_checkParameters(array('import_type', 'format')); |