~ubuntu-branches/ubuntu/lucid/phpmyadmin/lucid

« back to all changes in this revision

Viewing changes to db_create.php

  • Committer: Bazaar Package Importer
  • Author(s): Thijs Kinkhorst
  • Date: 2008-07-15 20:41:25 UTC
  • mfrom: (1.1.22 upstream)
  • Revision ID: james.westby@ubuntu.com-20080715204125-l55hj3njg6bhjkaj
Tags: 4:2.11.7.1-1
* New upstream release.
* Fixes security issue: XSRF/CSRF by manipulating the
  db, convcharset and collation_connection parameters.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
/* vim: set expandtab sw=4 ts=4 sts=4: */
3
3
/**
4
4
 *
5
 
 * @version $Id: db_create.php 10469 2007-06-29 14:22:48Z lem9 $
 
5
 * @version $Id: db_create.php 11389 2008-07-15 14:04:44Z lem9 $
6
6
 */
7
7
 
8
8
/**
12
12
$js_to_run = 'functions.js';
13
13
require_once './libraries/mysql_charsets.lib.php';
14
14
 
15
 
PMA_checkParameters(array('db'));
 
15
PMA_checkParameters(array('new_db'));
16
16
 
17
17
/**
18
18
 * Defines the url to return to in case of error in a sql statement
22
22
/**
23
23
 * Builds and executes the db creation sql query
24
24
 */
25
 
$sql_query = 'CREATE DATABASE ' . PMA_backquote($db);
 
25
$sql_query = 'CREATE DATABASE ' . PMA_backquote($new_db);
26
26
if (!empty($db_collation) && PMA_MYSQL_INT_VERSION >= 40101) {
27
27
    list($db_charset) = explode('_', $db_collation);
28
28
    if (in_array($db_charset, $mysql_charsets) && in_array($db_collation, $mysql_collations[$db_charset])) {
42
42
    require_once './libraries/header.inc.php';
43
43
    require_once './main.php';
44
44
} else {
45
 
    $message = $strDatabase . ' ' . htmlspecialchars($db) . ' ' . $strHasBeenCreated;
 
45
    $message = $strDatabase . ' ' . htmlspecialchars($new_db) . ' ' . $strHasBeenCreated;
 
46
    $GLOBALS['db'] = $new_db;
46
47
    require_once './libraries/header.inc.php';
47
48
    require_once './' . $cfg['DefaultTabDatabase'];
48
49
}