From dc4e4bbae80d740f5e9be761eebcd5f6342e988f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Chapeaux?= Date: Fri, 31 Aug 2001 21:00:00 +0000 Subject: [PATCH] patch #455752 - Check forbidden words thanks to Dell'Aiera Pol & Olivier Blin --- tbl_copy.php3 | 5 +++++ tbl_rename.php3 | 11 +++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/tbl_copy.php3 b/tbl_copy.php3 index 360c58095..2924ba7b7 100755 --- a/tbl_copy.php3 +++ b/tbl_copy.php3 @@ -52,6 +52,11 @@ if (isset($new_name) && trim($new_name) != '') { } $new_name = stripslashes($new_name); } + if (MYSQL_INT_VERSION < 32306) { + check_reserved_words($db); + check_reserved_words($table); + } + $source = backquote($db) . '.' . backquote($table); $target = backquote($target_db) . '.' . backquote($new_name); diff --git a/tbl_rename.php3 b/tbl_rename.php3 index 78ca1b36e..9c8406483 100755 --- a/tbl_rename.php3 +++ b/tbl_rename.php3 @@ -13,8 +13,15 @@ require('./lib.inc.php3'); * A new name has been submitted -> do the work */ if (isset($new_name) && trim($new_name) != '') { - $old_name = $table; - $table = $new_name; + $old_name = $table; + $table = $new_name; + if (get_magic_quotes_gpc()) { + $new_name = stripslashes($new_name); + } + if (MYSQL_INT_VERSION < 32306) { + check_reserved_words($new_name); + } + include('./header.inc.php3'); mysql_select_db($db); $local_query = 'ALTER TABLE ' . backquote($old_name) . ' RENAME ' . backquote($new_name);