error if dot in the new table name

This commit is contained in:
Marc Delisle
2003-11-24 19:00:29 +00:00
parent a4a1ca2f82
commit d1e105a862
2 changed files with 11 additions and 3 deletions

View File

@@ -5,6 +5,10 @@ phpMyAdmin - Changelog
$Id$
$Source$
2003-11-24 Marc Delisle <lem9@users.sourceforge.net>
* tbl_rename.php: give an error if the new table name has a dot
in its name, to avoid doing our automatic relation-table renames
2003-11-24 Michal Cihar <nijel@users.sourceforge.net>
* libraries/common.lib.php: Use preg again, it just needs a bit more
escaping of \ (once for PHP and once for PCRE).

View File

@@ -21,7 +21,7 @@ $err_url = 'tbl_properties.php?' . PMA_generate_common_url($db, $table);
/**
* A new name has been submitted -> do the work
*/
if (isset($new_name) && trim($new_name) != '') {
if (isset($new_name) && trim($new_name) != '' && strpos($new_name,'.') === FALSE) {
$old_name = $table;
$table = $new_name;
@@ -95,7 +95,11 @@ if (isset($new_name) && trim($new_name) != '') {
*/
else {
include('./header.inc.php');
PMA_mysqlDie($strTableEmpty, '', '', $err_url);
if (strpos($new_name,'.') === FALSE) {
PMA_mysqlDie($strTableEmpty, '', '', $err_url);
} else {
PMA_mysqlDie($strError . ': ' . $new_name, '', '', $err_url);
}
}