From c35072dc71cbbfbd7f79a131755fb456ca0747f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 18 Oct 2016 11:47:04 +0000 Subject: [PATCH 1/6] Translated using Weblate (Korean) Currently translated at 79.9% (2564 of 3206 strings) [CI skip] --- po/ko.po | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/po/ko.po b/po/ko.po index 5b7a1f4213..992f284846 100644 --- a/po/ko.po +++ b/po/ko.po @@ -4,10 +4,10 @@ msgstr "" "Project-Id-Version: phpMyAdmin 4.6.5-dev\n" "Report-Msgid-Bugs-To: translators@phpmyadmin.net\n" "POT-Creation-Date: 2016-10-18 13:42+0200\n" -"PO-Revision-Date: 2016-10-18 11:30+0000\n" -"Last-Translator: SDSkyKlouD \n" -"Language-Team: Korean \n" +"PO-Revision-Date: 2016-10-18 11:46+0000\n" +"Last-Translator: Michal Čihař \n" +"Language-Team: Korean " +"\n" "Language: ko\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -954,12 +954,6 @@ msgid "" "column(s) editing feature (the \"Change\" Link) on the table structure page. " "" msgstr "" -"Através desta operação, o MySQL tenta mapear os valores de dados entre " -"agrupamentos. Se os conjuntos de caracteres são incompatíveis, pode haver " -"perda de dados e esta perda de dados pode Não ser recuperável " -"simplesmente mudando de volta o(s) agrupamento (s). \n" -"Para converter os dados existentes, sugere-se usar as colunas de recurso " -"de edição (o \"Mudar\" Link) na página de estrutura da tabela" #: js/messages.php:102 msgid "" From 34ca139578c00b0643dca6699e69f978fc51304e Mon Sep 17 00:00:00 2001 From: SDSkyKlouD Date: Tue, 18 Oct 2016 11:58:02 +0000 Subject: [PATCH 2/6] Translated using Weblate (Korean) Currently translated at 80.0% (2565 of 3206 strings) [CI skip] --- po/ko.po | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/po/ko.po b/po/ko.po index 992f284846..2f65601261 100644 --- a/po/ko.po +++ b/po/ko.po @@ -4,8 +4,8 @@ msgstr "" "Project-Id-Version: phpMyAdmin 4.6.5-dev\n" "Report-Msgid-Bugs-To: translators@phpmyadmin.net\n" "POT-Creation-Date: 2016-10-18 13:42+0200\n" -"PO-Revision-Date: 2016-10-18 11:46+0000\n" -"Last-Translator: Michal Čihař \n" +"PO-Revision-Date: 2016-10-18 11:57+0000\n" +"Last-Translator: SDSkyKlouD \n" "Language-Team: Korean " "\n" "Language: ko\n" @@ -954,6 +954,12 @@ msgid "" "column(s) editing feature (the \"Change\" Link) on the table structure page. " "" msgstr "" +"Através desta operação, o MySQL tenta mapear os valores de dados entre " +"agrupamentos. Se os conjuntos de caracteres são incompatíveis, pode haver " +"perda de dados e esta perda de dados pode Não ser recuperável " +"simplesmente mudando de volta o(s) agrupamento (s). \n" +"Para converter os dados existentes, sugere-se usar as colunas de recurso " +"de edição (o \"Mudar\" Link) na página de estrutura da tabela" #: js/messages.php:102 msgid "" From 9e5a1e95fe2f4d8c7a520cf157c0b60559b1c7b1 Mon Sep 17 00:00:00 2001 From: SDSkyKlouD Date: Tue, 18 Oct 2016 12:02:10 +0000 Subject: [PATCH 3/6] Translated using Weblate (Korean) Currently translated at 79.8% (2561 of 3206 strings) [CI skip] Deleted wrong language translation ;( --- po/ko.po | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/po/ko.po b/po/ko.po index 2f65601261..3cb65cc936 100644 --- a/po/ko.po +++ b/po/ko.po @@ -4,7 +4,7 @@ msgstr "" "Project-Id-Version: phpMyAdmin 4.6.5-dev\n" "Report-Msgid-Bugs-To: translators@phpmyadmin.net\n" "POT-Creation-Date: 2016-10-18 13:42+0200\n" -"PO-Revision-Date: 2016-10-18 11:57+0000\n" +"PO-Revision-Date: 2016-10-18 12:02+0000\n" "Last-Translator: SDSkyKlouD \n" "Language-Team: Korean " "\n" @@ -954,12 +954,6 @@ msgid "" "column(s) editing feature (the \"Change\" Link) on the table structure page. " "" msgstr "" -"Através desta operação, o MySQL tenta mapear os valores de dados entre " -"agrupamentos. Se os conjuntos de caracteres são incompatíveis, pode haver " -"perda de dados e esta perda de dados pode Não ser recuperável " -"simplesmente mudando de volta o(s) agrupamento (s). \n" -"Para converter os dados existentes, sugere-se usar as colunas de recurso " -"de edição (o \"Mudar\" Link) na página de estrutura da tabela" #: js/messages.php:102 msgid "" @@ -1882,8 +1876,6 @@ msgid "" "No columns in the central list. Make sure the Central columns list for " "database %s has columns that are not present in the current table." msgstr "" -"Não há colunas na lista central. Certifique-se a lista de colunas central do " -"banco de dados %s tem colunas que não estão presentes na tabela atual." #: js/messages.php:421 msgid "See more" @@ -1948,8 +1940,6 @@ msgid "" "Note: a, b -> d,f implies values of columns a and b combined together can " "determine values of column d and column f." msgstr "" -"Nota: a, b -> d, f implicar valores de colunas a e b em conjunto combinado " -"pode determinar os valores das colunas d e f." #: js/messages.php:444 msgid "No partial dependencies selected!" @@ -1994,7 +1984,7 @@ msgstr "정규화의 세번째 단계 (3NF)" #: js/messages.php:461 msgid "Confirm transitive dependencies" -msgstr "Confirmar dependências transitivas" +msgstr "" #: js/messages.php:462 msgid "Selected dependencies are as follows:" From 587309a4b2b72f8b68ea4041b0da276e8db7fc14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=A0=CE=B1=CE=BD=CE=B1=CE=B3=CE=B9=CF=8E=CF=84=CE=B7?= =?UTF-8?q?=CF=82=20=CE=A0=CE=B1=CF=80=CE=AC=CE=B6=CE=BF=CE=B3=CE=BB=CE=BF?= =?UTF-8?q?=CF=85?= Date: Tue, 18 Oct 2016 19:42:08 +0000 Subject: [PATCH 4/6] Translated using Weblate (Greek) Currently translated at 100.0% (3218 of 3218 strings) [CI skip] --- po/el.po | 41 ++++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/po/el.po b/po/el.po index 873213fbbd..a1949b841c 100644 --- a/po/el.po +++ b/po/el.po @@ -4,16 +4,16 @@ msgstr "" "Project-Id-Version: phpMyAdmin 4.6.5-dev\n" "Report-Msgid-Bugs-To: translators@phpmyadmin.net\n" "POT-Creation-Date: 2016-10-18 13:42+0200\n" -"PO-Revision-Date: 2016-08-20 21:29+0000\n" +"PO-Revision-Date: 2016-10-18 19:52+0000\n" "Last-Translator: Παναγιώτης Παπάζογλου \n" -"Language-Team: Greek \n" +"Language-Team: Greek " +"\n" "Language: el\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 2.8-dev\n" +"X-Generator: Weblate 2.9-dev\n" #: changelog.php:38 license.php:33 #, php-format @@ -1828,6 +1828,8 @@ msgstr "Εξαγωγή" #: js/messages.php:389 msgid "No routine is exportable. Required privileges may be lacking." msgstr "" +"Καμιά ρουτίνα δεν είναι εξαγώγιμη. Ίσως υπάρχει έλλειψη απαιτούμενων " +"δικαιωμάτων." #: js/messages.php:392 libraries/rte/rte_routines.lib.php:754 msgid "ENUM/SET editor" @@ -2952,6 +2954,8 @@ msgstr "Αποτυχία διαμόρφωσης κειμένου για τον #, php-format msgid "Error in reading file: The file '%s' does not exist or is not readable!" msgstr "" +"Σφάλμα στην ανάγνωση αρχείου: Το αρχείο «%s» δεν υπάρχει ή δεν είναι " +"αναγνώσιμο!" #: libraries/Advisor.php:492 #, php-format @@ -11983,6 +11987,8 @@ msgid "" "No routine with name %1$s found in database %2$s. You might be lacking the " "necessary privileges to edit this routine" msgstr "" +"Καμιά ρουτίνα με το όνομα %1$s δεν βρέθηκε στη βάση δεδομένων %2$s. Ίσως δεν " +"έχετε τα απαραίτητα δικαιώματα για επεξεργασία της ρουτίνας" #: libraries/rte/rte_words.lib.php:39 #, php-format @@ -11990,6 +11996,8 @@ msgid "" "No routine with name %1$s found in database %2$s. You might be lacking the " "necessary privileges to view/export this routine" msgstr "" +"Καμιά ρουτίνα με το όνομα %1$s δεν βρέθηκε στη βάση δεδομένων %2$s. Ίσως δεν " +"έχετε τα απαραίτητα δικαιώματα για προβολή/εξάγωγή της ρουτίνας" #: libraries/rte/rte_words.lib.php:42 #, php-format @@ -12329,6 +12337,8 @@ msgid "" "Allows user to give to other users or remove from other users privileges " "that user possess on this routine." msgstr "" +"Επιτρέπει στο χρήστη για δίνει σε άλλους χρήστες ή να απομακρύνει από άλλους " +"χρήστες δικαιώματα που ο χρήστης κατέχει σε αυτή τη ρουτίνα." #: libraries/server_privileges.lib.php:1042 msgid "Allows altering and dropping this routine." @@ -12390,6 +12400,8 @@ msgid "" "Allows user to give to other users or remove from other users the privileges " "that user possess yourself." msgstr "" +"Επιτρέπει το χρήστη να δώσει σε άλλους χρήστες ή απομακρύνει από άλλους " +"χρήστες τα δικαιώματα που ο χρήστης κατέχει από μόνος του." #: libraries/server_privileges.lib.php:1552 msgid "Native MySQL authentication" @@ -13898,20 +13910,20 @@ msgstr "Αναμενόταν μια ανοιχτή αγκύλη." #: libraries/sql-parser/src/Statements/InsertStatement.php:227 #: libraries/sql-parser/src/Statements/ReplaceStatement.php:165 #: libraries/sql-parser/src/Statements/ReplaceStatement.php:193 -#, fuzzy -#| msgid "Unexpected token." msgid "Unexpected keyword." -msgstr "Μη αναμενόμενο τεκμήριο." +msgstr "Μη αναμενόμενη λέξη-κλειδί." #: libraries/sql-parser/src/Components/CaseExpression.php:202 msgid "Unexpected end of CASE expression" -msgstr "" +msgstr "Μη αναμενόμενο τέλος της έκφρασης CASE" #: libraries/sql-parser/src/Components/CreateDefinition.php:227 msgid "" "A symbol name was expected! A reserved keyword can not be used as a field " "name without backquotes." msgstr "" +"Αναμενόταν ένα όνομα συμβόλου! Μια δεσμευμένη λέξη-κλειδί δεν μπορεί να " +"χρησιμοποιηθεί ως όνομα πεδίου χωρίς εισαγωγικά." #: libraries/sql-parser/src/Components/CreateDefinition.php:241 msgid "A symbol name was expected!" @@ -13959,10 +13971,9 @@ msgid "This option conflicts with \"%1$s\"." msgstr "Αυτή η επιλογή έχει διαίνεξη με το «%1$s»." #: libraries/sql-parser/src/Components/OptionsArray.php:260 -#, fuzzy, php-format -#| msgid "Ending quote %1$s was expected." +#, php-format msgid "Value/Expression for the option %1$s was expected" -msgstr "Αναμενόταν τελικό εισαγωγικό %1$s." +msgstr "Αναμενόταν Τιμή/Έκφραση για την επιλογή %1$s" #: libraries/sql-parser/src/Components/RenameOperation.php:101 msgid "The old name of the table was expected." @@ -14036,10 +14047,8 @@ msgid "The name of the entity was expected." msgstr "Αναμενόταν το όνομα της οντότητας." #: libraries/sql-parser/src/Statements/CreateStatement.php:436 -#, fuzzy -#| msgid "Variable name was expected." msgid "A table name was expected." -msgstr "Αναμενόταν όνομα μεταβλητής." +msgstr "Αναμενόταν όνομα πίνακα." #: libraries/sql-parser/src/Statements/CreateStatement.php:444 msgid "At least one column definition was expected." @@ -14050,10 +14059,8 @@ msgid "A \"RETURNS\" keyword was expected." msgstr "Αναμενόταν μια λέξη-κλειδί «RETURNS»." #: libraries/sql-parser/src/Statements/DeleteStatement.php:303 -#, fuzzy -#| msgid "This type of clause was previously parsed." msgid "This type of clause is not valid in Multi-table queries." -msgstr "Αυτός ο τύπος ρύτρας έχει αναλυθεί προηγουμένως." +msgstr "Αυτός ο τύπος ρύτρας δεν είναι έγκυρος σε ερωτήματα πολλαπλών πινάκων." #: libraries/sql.lib.php:231 msgid "Detailed profile" From 1eac9c5ec23d03feb164c4729ceeb0eda4ca0cda Mon Sep 17 00:00:00 2001 From: Deven Bansod Date: Wed, 19 Oct 2016 15:17:39 +0530 Subject: [PATCH 5/6] Proper initialization of $_message variable according to value of $result While calling getDisplay, $_message should be an instance of PMA\libraries\Message. Fix #12650 Also, spaces at the beginning of a table name are allowed if used inside backquotes. Signed-off-by: Deven Bansod --- libraries/Table.php | 18 +++++++++++++----- tbl_operations.php | 5 +++++ 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/libraries/Table.php b/libraries/Table.php index 342e94cb4d..33cde1139b 100644 --- a/libraries/Table.php +++ b/libraries/Table.php @@ -1245,17 +1245,22 @@ class Table * checks if given name is a valid table name, * currently if not empty, trailing spaces, '.', '/' and '\' * - * @param string $table_name name to check + * @param string $table_name name to check + * @param boolean $is_backquoted whether this name is used inside backquotes or not * * @todo add check for valid chars in filename on current system/os * @see https://dev.mysql.com/doc/refman/5.0/en/legal-names.html * * @return boolean whether the string is valid or not */ - static function isValidName($table_name) + static function isValidName($table_name, $is_backquoted = false) { - if ($table_name !== trim($table_name)) { - // trailing spaces + if ($table_name !== rtrim($table_name)) { + // trailing spaces not allowed even in backquotes + return false; + } + if (! $is_backquoted && $table_name !== trim($table_name)) { + // spaces at the start or in between return false; } @@ -1310,7 +1315,10 @@ class Table return true; } - if (! Table::isValidName($new_name)) { + // Allow whitespaces (not trailing) in $new_name, + // since we are using $backquoted in getting the fullName of table + // below to be used in the query + if (! Table::isValidName($new_name, true)) { $this->errors[] = __('Invalid table name:') . ' ' . $new_table->getFullName(); return false; diff --git a/tbl_operations.php b/tbl_operations.php index 4f3b66760e..3c3754d7f4 100644 --- a/tbl_operations.php +++ b/tbl_operations.php @@ -226,7 +226,12 @@ if (isset($result) && empty($message_to_show)) { } exit; } + } else { + $_message = $result + ? PMA\libraries\Message::success($_message) + : PMA\libraries\Message::error($_message); } + if (! empty($warning_messages)) { $_message = new PMA\libraries\Message; $_message->addMessages($warning_messages); From 7d0e0b3163b713ecdbfa6977fd6c447f859f8f0f Mon Sep 17 00:00:00 2001 From: Deven Bansod Date: Wed, 19 Oct 2016 15:20:18 +0530 Subject: [PATCH 6/6] Add tests for validation of tablenames Signed-off-by: Deven Bansod --- test/classes/TableTest.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/classes/TableTest.php b/test/classes/TableTest.php index 508d167ce7..08b9a40d3a 100644 --- a/test/classes/TableTest.php +++ b/test/classes/TableTest.php @@ -385,11 +385,11 @@ class TableTest extends PMATestCase * * @dataProvider dataValidateName */ - public function testValidateName($name, $result) + public function testValidateName($name, $result, $is_backquoted=false) { $this->assertEquals( $result, - Table::isValidName($name) + Table::isValidName($name, $is_backquoted) ); } @@ -405,6 +405,10 @@ class TableTest extends PMATestCase array('te/st', false), array('te.st', false), array('te\\st', false), + array('te st', true), + array(' te st', true, true), + array('test ', false), + array('test ', false, true), ); }