From 4e68ada908a39c83feb4601358f3ef5727b265d1 Mon Sep 17 00:00:00 2001 From: Chanaka Dharmarathna Date: Sat, 4 Oct 2014 11:40:39 +0530 Subject: [PATCH 01/14] Remove dead codes Signed-off-by: Chanaka Dharmarathna --- index.php | 1 - libraries/display_create_database.lib.php | 3 +-- libraries/mysql_charsets.lib.php | 4 ++-- libraries/operations.lib.php | 5 ++--- libraries/tbl_columns_definition_form.lib.php | 2 +- test/libraries/PMA_mysql_charsets_test.php | 2 +- 6 files changed, 7 insertions(+), 10 deletions(-) diff --git a/index.php b/index.php index 42e03df39e..2d33c3939b 100644 --- a/index.php +++ b/index.php @@ -198,7 +198,6 @@ if ($server > 0 || count($cfg['Servers']) > 1 'select_collation_connection', $collation_connection, true, - 4, true ) . ' ' . "\n" diff --git a/libraries/display_create_database.lib.php b/libraries/display_create_database.lib.php index 2662719dc9..0f9ac15f40 100644 --- a/libraries/display_create_database.lib.php +++ b/libraries/display_create_database.lib.php @@ -36,8 +36,7 @@ if ($is_create_db_priv) { 'db_collation', null, null, - true, - 5 + true ); if (! empty($dbstats)) { diff --git a/libraries/mysql_charsets.lib.php b/libraries/mysql_charsets.lib.php index a5b3dbdfac..f01b1b5465 100644 --- a/libraries/mysql_charsets.lib.php +++ b/libraries/mysql_charsets.lib.php @@ -24,8 +24,8 @@ if (! defined('PHPMYADMIN')) { * @return string */ function PMA_generateCharsetDropdownBox($type = PMA_CSDROPDOWN_COLLATION, - $name = null, $id = null, $default = null, $label = true, $indent = 0, - $submitOnChange = false, $displayUnavailable = false + $name = null, $id = null, $default = null, $label = true, + $submitOnChange = false ) { global $mysql_charsets, $mysql_charsets_descriptions, $mysql_charsets_available, $mysql_collations, $mysql_collations_available; diff --git a/libraries/operations.lib.php b/libraries/operations.lib.php index e9097a151c..eb8132626b 100644 --- a/libraries/operations.lib.php +++ b/libraries/operations.lib.php @@ -245,8 +245,7 @@ function PMA_getHtmlForChangeDatabaseCharset($db, $table) 'db_collation', 'select_db_collation', isset($_REQUEST['db_collation']) ? $_REQUEST['db_collation'] : '', - false, - 3 + false ) . '' . '
' @@ -797,7 +796,7 @@ function PMA_getTableOptionFieldset($comment, $tbl_collation, . '' . PMA_generateCharsetDropdownBox( PMA_CSDROPDOWN_COLLATION, - 'tbl_collation', null, $tbl_collation, false, 3 + 'tbl_collation', null, $tbl_collation, false ) . '' . ''; diff --git a/libraries/tbl_columns_definition_form.lib.php b/libraries/tbl_columns_definition_form.lib.php index 68e3d61a61..0d6686a462 100644 --- a/libraries/tbl_columns_definition_form.lib.php +++ b/libraries/tbl_columns_definition_form.lib.php @@ -100,7 +100,7 @@ function PMA_getHtmlForTableConfigurations() ? $_REQUEST['tbl_collation'] : null ), - false, 3 + false ) . '' . ''; diff --git a/test/libraries/PMA_mysql_charsets_test.php b/test/libraries/PMA_mysql_charsets_test.php index 638ca049ce..7488f54c26 100644 --- a/test/libraries/PMA_mysql_charsets_test.php +++ b/test/libraries/PMA_mysql_charsets_test.php @@ -284,7 +284,7 @@ class PMA_MySQL_Charsets_Test extends PHPUnit_Framework_TestCase $this->assertContains('title="German', $result); $result = PMA_generateCharsetDropdownBox( - 2, null, "test_id", "latin1", false, 0, true, false + 2, null, "test_id", "latin1", false, true ); $this->assertContains('name="character_set"', $result); $this->assertNotContains('Charset', $result); From 03debd0a6eafa1277e7a15ca5d4748bfed5f5054 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sat, 4 Oct 2014 08:27:50 -0400 Subject: [PATCH 02/14] Refactor: we had three similar functions, refactored into just one. Also, these functions returned false, or a string containing the type, but the string was only used to indirectly mean a true value; now we explicitely return true in this case. Signed-off-by: Marc Delisle --- libraries/insert_edit.lib.php | 87 +++++++------------------ tbl_change.php | 5 +- test/libraries/PMA_insert_edit_test.php | 76 +++++++++------------ 3 files changed, 60 insertions(+), 108 deletions(-) diff --git a/libraries/insert_edit.lib.php b/libraries/insert_edit.lib.php index 901d9ed725..4cb8ba0aa7 100644 --- a/libraries/insert_edit.lib.php +++ b/libraries/insert_edit.lib.php @@ -267,9 +267,19 @@ function PMA_analyzeTableColumnsArray($column, $comments_map, $timestamp_seen) $column['True_Type'] = preg_replace('@\(.*@s', '', $column['Type']); $column['len'] = preg_match('@float|double@', $column['Type']) ? 100 : -1; $column['Field_title'] = PMA_getColumnTitle($column, $comments_map); - $column['is_binary'] = PMA_isColumnBinary($column); - $column['is_blob'] = PMA_isColumnBlob($column); - $column['is_char'] = PMA_isColumnChar($column); + $column['is_binary'] = PMA_isColumn( + $column, + array('binary', 'varbinary') + ); + $column['is_blob'] = PMA_isColumn( + $column, + array('blob', 'tinyblob', 'mediumblob', 'longblob') + ); + $column['is_char'] = PMA_isColumn( + $column, + array('char', 'varchar') + ); + list($column['pma_type'], $column['wrap'], $column['first_timestamp']) = PMA_getEnumSetAndTimestampColumns($column, $timestamp_seen); @@ -296,77 +306,28 @@ function PMA_getColumnTitle($column, $comments_map) } /** - * check whether the column is a binary + * check whether the column is of a certain type + * the goal is to ensure that types such as "enum('one','two','binary',..)" + * or "enum('one','two','varbinary',..)" are not categorized as binary * * @param array $column description of column in given table + * @param array $types the types to verify * - * @return boolean If check to ensure types such as "enum('one','two','binary',..)" - * or "enum('one','two','varbinary',..)" are not categorized as - * binary. + * @return boolean whether the column's type if one of the $types */ -function PMA_isColumnBinary($column) +function PMA_isColumn($column, $types) { /** @var PMA_String $pmaString */ $pmaString = $GLOBALS['PMA_String']; - // The type column. - // Fix for bug #3152931 'ENUM and SET cannot have "Binary" option' - if ($pmaString->stripos($column['Type'], 'binary') === 0 - || $pmaString->stripos($column['Type'], 'varbinary') === 0 - ) { - return stristr($column['Type'], 'binary'); - } else { - return false; + foreach ($types as $one_type) { + if ($pmaString->stripos($column['Type'], $one_type) === 0) { + return true; + } } - + return false; } - /** - * check whether the column is a blob - * - * @param array $column description of column in given table - * - * @return boolean If check to ensure types such as "enum('one','two','blob',..)" - * or "enum('one','two','tinyblob',..)" etc. are not categorized - * as blob. - */ -function PMA_isColumnBlob($column) -{ - /** @var PMA_String $pmaString */ - $pmaString = $GLOBALS['PMA_String']; - - if ($pmaString->stripos($column['Type'], 'blob') === 0 - || $pmaString->stripos($column['Type'], 'tinyblob') === 0 - || $pmaString->stripos($column['Type'], 'mediumblob') === 0 - || $pmaString->stripos($column['Type'], 'longblob') === 0 - ) { - return stristr($column['Type'], 'blob'); - } else { - return false; - } -} - -/** - * check is table column char - * - * @param array $column description of column in given table - * - * @return boolean If check to ensure types such as "enum('one','two','char',..)" or - * "enum('one','two','varchar',..)" are not categorized as char. - */ -function PMA_isColumnChar($column) -{ - /** @var PMA_String $pmaString */ - $pmaString = $GLOBALS['PMA_String']; - - if ($pmaString->stripos($column['Type'], 'char') === 0 - || $pmaString->stripos($column['Type'], 'varchar') === 0 - ) { - return stristr($column['Type'], 'char'); - } else { - return false; - } -} /** * Retrieve set, enum, timestamp table columns * diff --git a/tbl_change.php b/tbl_change.php index c0f468d355..e3f4a433e2 100644 --- a/tbl_change.php +++ b/tbl_change.php @@ -135,7 +135,10 @@ $url_params = PMA_urlParamsInEditMode( $has_blob_field = false; foreach ($table_columns as $column) { - if (PMA_isColumnBlob($column)) { + if (PMA_isColumn( + $column, + array('blob', 'tinyblob', 'mediumblob', 'longblob') + )) { $has_blob_field = true; break; } diff --git a/test/libraries/PMA_insert_edit_test.php b/test/libraries/PMA_insert_edit_test.php index cbb66a4fcd..1240eef2bb 100644 --- a/test/libraries/PMA_insert_edit_test.php +++ b/test/libraries/PMA_insert_edit_test.php @@ -451,69 +451,57 @@ class PMA_InsertEditTest extends PHPUnit_Framework_TestCase } /** - * Test for PMA_isColumnBinary + * Test for PMA_isColumn * * @return void */ - public function testIsColumnBinary() + public function testIsColumn() { $column = array(); + $types = array('binary', 'varbinary'); + $column['Type'] = 'binaryfoo'; - $this->assertEquals('binaryfoo', PMA_isColumnBinary($column)); + $this->assertTrue(PMA_isColumn($column, $types)); $column['Type'] = 'Binaryfoo'; - $this->assertEquals('Binaryfoo', PMA_isColumnBinary($column)); + $this->assertTrue(PMA_isColumn($column, $types)); $column['Type'] = 'varbinaryfoo'; - $this->assertEquals('binaryfoo', PMA_isColumnBinary($column)); + $this->assertTrue(PMA_isColumn($column, $types)); $column['Type'] = 'barbinaryfoo'; - $this->assertFalse(PMA_isColumnBinary($column)); - } + $this->assertFalse(PMA_isColumn($column, $types)); - /** - * Test for PMA_isColumnBlob - * - * @return void - */ - public function testIsColumnBlob() - { - $column = array(); - $column['Type'] = 'blob'; - $this->assertEquals('blob', PMA_isColumnBlob($column)); + $types = array('char', 'varchar'); - $column['Type'] = 'bloB'; - $this->assertEquals('bloB', PMA_isColumnBlob($column)); - - $column['Type'] = 'mediumBloB'; - $this->assertEquals('BloB', PMA_isColumnBlob($column)); - - $column['Type'] = 'tinyblobabc'; - $this->assertEquals('blobabc', PMA_isColumnBlob($column)); - - $column['Type'] = 'longblob'; - $this->assertEquals('blob', PMA_isColumnBlob($column)); - - $column['Type'] = 'foolongblobbar'; - $this->assertFalse(PMA_isColumnBlob($column)); - } - - /** - * Test for PMA_iscolumnchar - * - * @return void - */ - public function testIsColumnChar() - { - $column = array(); $column['Type'] = 'char(10)'; - $this->assertEquals('char(10)', PMA_iscolumnchar($column)); + $this->assertTrue(PMA_isColumn($column, $types)); $column['Type'] = 'VarChar(20)'; - $this->assertEquals('Char(20)', PMA_iscolumnchar($column)); + $this->assertTrue(PMA_isColumn($column, $types)); $column['Type'] = 'foochar'; - $this->assertFalse(PMA_iscolumnchar($column)); + $this->assertFalse(PMA_isColumn($column, $types)); + + $types = array('blob', 'tinyblob', 'mediumblob', 'longblob'); + + $column['Type'] = 'blob'; + $this->assertTrue(PMA_isColumn($column, $types)); + + $column['Type'] = 'bloB'; + $this->assertTrue(PMA_isColumn($column, $types)); + + $column['Type'] = 'mediumBloB'; + $this->assertTrue(PMA_isColumn($column, $types)); + + $column['Type'] = 'tinyblobabc'; + $this->assertTrue(PMA_isColumn($column, $types)); + + $column['Type'] = 'longblob'; + $this->assertTrue(PMA_isColumn($column, $types)); + + $column['Type'] = 'foolongblobbar'; + $this->assertFalse(PMA_isColumn($column, $types)); } /** From 9ea91627cf4c1059519a29ab81ab521481b86399 Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Sat, 4 Oct 2014 18:18:17 +0530 Subject: [PATCH 03/14] 'same' and 'new' are the only choices here Signed-off-by: Madhura Jayaratne --- db_designer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db_designer.php b/db_designer.php index 12492f8639..cf1b9625fe 100644 --- a/db_designer.php +++ b/db_designer.php @@ -45,7 +45,7 @@ if (isset($_REQUEST['operation'])) { } elseif ($_REQUEST['operation'] == 'savePage') { if ($_REQUEST['save_page'] == 'same') { $page = $_REQUEST['selected_page']; - } elseif ($_REQUEST['save_page'] == 'new') { + } else { // new $page = PMA_createNewPage($_REQUEST['selected_value'], $GLOBALS['db']); $response->addJSON('id', $page); } From 29bf47e49b7f4eabbedf0bb14ff7edbaea5a44de Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Sat, 4 Oct 2014 18:22:51 +0530 Subject: [PATCH 04/14] Define $message in all paths Signed-off-by: Madhura Jayaratne --- db_operations.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/db_operations.php b/db_operations.php index 9d48bb3009..5a1979ebe6 100644 --- a/db_operations.php +++ b/db_operations.php @@ -142,6 +142,8 @@ if ($pmaString->strlen($GLOBALS['db']) ); $message->addParam($GLOBALS['db']); $message->addParam($_REQUEST['newname']); + } else { + $message = PMA_Message::error(); } $reload = true; @@ -158,10 +160,6 @@ if ($pmaString->strlen($GLOBALS['db']) $GLOBALS['PMA_Config']->setCookie('pma_switch_to_new', ''); } } - - if ($_error && ! isset($message)) { - $message = PMA_Message::error(); - } } /** From 241aa4767aad59da5f9a1ce577bca53242da311e Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Sat, 4 Oct 2014 18:24:43 +0530 Subject: [PATCH 05/14] Define $sql_query in all paths Signed-off-by: Madhura Jayaratne --- db_operations.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db_operations.php b/db_operations.php index 5a1979ebe6..e18fff6441 100644 --- a/db_operations.php +++ b/db_operations.php @@ -43,12 +43,12 @@ if ($pmaString->strlen($GLOBALS['db']) $move = false; } + $sql_query = ''; if (! isset($_REQUEST['newname']) || ! $pmaString->strlen($_REQUEST['newname']) ) { $message = PMA_Message::error(__('The database name is empty!')); } else { - $sql_query = ''; // in case target db exists $_error = false; if ($move || (isset($_REQUEST['create_database_before_copying']) From 92ca4abe59c76bd35c40afea63af614520524259 Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Sat, 4 Oct 2014 18:36:26 +0530 Subject: [PATCH 06/14] Fix bad line breaks Signed-off-by: Madhura Jayaratne --- js/pmd/move.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/js/pmd/move.js b/js/pmd/move.js index 9221cb93c6..d9f1380259 100644 --- a/js/pmd/move.js +++ b/js/pmd/move.js @@ -350,9 +350,9 @@ function Re_load() row_offset_top = document.getElementById(key2 + "." + key3).offsetTop; } - var y1 = document.getElementById(key2).offsetTop - + row_offset_top - + height_field; + var y1 = document.getElementById(key2).offsetTop + + row_offset_top + + height_field; //alert(1); row_offset_top = 0; @@ -363,9 +363,9 @@ function Re_load() } var y2 = - document.getElementById(contr[K][key][key2][key3][0]).offsetTop - + row_offset_top - + height_field; + document.getElementById(contr[K][key][key2][key3][0]).offsetTop + + row_offset_top + + height_field; //alert(y1 + ' - ' + key2 + "." + key3); Line0( @@ -661,8 +661,8 @@ function Save3(callback) .append('') .append('') .append('') - .append(':'); + .append(':'); $('
') .append($form) .dialog({ From d274064d54210be663cd0f49fc5975faf9b67983 Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Sat, 4 Oct 2014 18:40:26 +0530 Subject: [PATCH 07/14] Avoid bad line breaks Signed-off-by: Madhura Jayaratne --- js/navigation.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/js/navigation.js b/js/navigation.js index f5971c507f..90fd346e3c 100644 --- a/js/navigation.js +++ b/js/navigation.js @@ -346,8 +346,7 @@ $(function () { ); // Update localStorage. if (window.localStorage && window.localStorage !== undefined) { - window.localStorage.favorite_tables - = data.favorite_tables; + window.localStorage.favorite_tables = data.favorite_tables; } } else { PMA_ajaxShowMessage(data.message); From efa06c360b8961e730c0fea558bacf9622137a9c Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Sat, 4 Oct 2014 19:13:34 +0530 Subject: [PATCH 08/14] Function does not handle null values even if it was documented to handle them Signed-off-by: Madhura Jayaratne --- libraries/tbl_relation.lib.php | 16 ++++++++-------- tbl_relation.php | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libraries/tbl_relation.lib.php b/libraries/tbl_relation.lib.php index 32668eb12c..38e96b4c9a 100644 --- a/libraries/tbl_relation.lib.php +++ b/libraries/tbl_relation.lib.php @@ -170,14 +170,14 @@ function PMA_generateRelationalDropdown( /** * Function to get html for the common form * - * @param string $db current database - * @param string $table current table - * @param array $columns columns - * @param array $cfgRelation configuration relation - * @param string $tbl_storage_engine table storage engine - * @param array|null $existrel db, table, column - * @param array|null $existrel_foreign db, table, column - * @param array $options_array options array + * @param string $db current database + * @param string $table current table + * @param array $columns columns + * @param array $cfgRelation configuration relation + * @param string $tbl_storage_engine table storage engine + * @param array $existrel db, table, column + * @param array $existrel_foreign db, table, column + * @param array $options_array options array * * @return string */ diff --git a/tbl_relation.php b/tbl_relation.php index 77aca0daee..fdd959373b 100644 --- a/tbl_relation.php +++ b/tbl_relation.php @@ -154,7 +154,7 @@ $columns = $GLOBALS['dbi']->getColumns($db, $table); $html_output .= PMA_getHtmlForCommonForm( $db, $table, $columns, $cfgRelation, $tbl_storage_engine, isset($existrel) ? $existrel : array(), - isset($existrel_foreign) ? $existrel_foreign['foreign_keys_data'] : null, + isset($existrel_foreign) ? $existrel_foreign['foreign_keys_data'] : array(), $options_array ); From 043aae9dbade86921681290aa9cd3aa2755d9d1e Mon Sep 17 00:00:00 2001 From: Xavier Navarro Date: Sun, 5 Oct 2014 19:39:22 +0200 Subject: [PATCH 09/14] Translated using Weblate (Catalan) Currently translated at 81.5% (2417 of 2965 strings) [CI skip] --- po/ca.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/po/ca.po b/po/ca.po index 6e3f34a01e..8d8fd84f3c 100644 --- a/po/ca.po +++ b/po/ca.po @@ -4,7 +4,7 @@ msgstr "" "Project-Id-Version: phpMyAdmin 4.3.0-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2014-10-02 11:40+0200\n" -"PO-Revision-Date: 2014-10-03 17:07+0200\n" +"PO-Revision-Date: 2014-10-05 19:39+0200\n" "Last-Translator: Xavier Navarro \n" "Language-Team: Catalan " "\n" @@ -1022,7 +1022,7 @@ msgstr "Reinicia" #: js/messages.php:53 #| msgid "Select All" msgid "Reset All" -msgstr "Restableix Tot" +msgstr "Tria Tot" #: js/messages.php:56 msgid "Missing value in the form!" From 66be2f7699c502628ab06f01c7156b34d76b92e3 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sun, 5 Oct 2014 17:31:56 -0400 Subject: [PATCH 10/14] Fix code execution path warning Signed-off-by: Marc Delisle --- db_operations.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/db_operations.php b/db_operations.php index e18fff6441..a21ec02227 100644 --- a/db_operations.php +++ b/db_operations.php @@ -29,6 +29,8 @@ $header = $response->getHeader(); $scripts = $header->getScripts(); $scripts->addFile('db_operations.js'); +$sql_query = ''; + /** * Rename/move or copy database */ @@ -43,7 +45,6 @@ if ($pmaString->strlen($GLOBALS['db']) $move = false; } - $sql_query = ''; if (! isset($_REQUEST['newname']) || ! $pmaString->strlen($_REQUEST['newname']) ) { From 4749ee4e733191b40350bc99a8c74017a7e3884d Mon Sep 17 00:00:00 2001 From: josep constanti Date: Sun, 5 Oct 2014 19:43:38 +0200 Subject: [PATCH 11/14] Translated using Weblate (Catalan) Currently translated at 81.6% (2420 of 2965 strings) [CI skip] --- po/ca.po | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/po/ca.po b/po/ca.po index 8d8fd84f3c..d870bfbfec 100644 --- a/po/ca.po +++ b/po/ca.po @@ -4,8 +4,8 @@ msgstr "" "Project-Id-Version: phpMyAdmin 4.3.0-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2014-10-02 11:40+0200\n" -"PO-Revision-Date: 2014-10-05 19:39+0200\n" -"Last-Translator: Xavier Navarro \n" +"PO-Revision-Date: 2014-10-05 19:43+0200\n" +"Last-Translator: josep constanti \n" "Language-Team: Catalan " "\n" "Language: ca\n" @@ -1022,7 +1022,7 @@ msgstr "Reinicia" #: js/messages.php:53 #| msgid "Select All" msgid "Reset All" -msgstr "Tria Tot" +msgstr "Reinicia Tot" #: js/messages.php:56 msgid "Missing value in the form!" @@ -5273,24 +5273,22 @@ msgstr "No s'ha pogut inicialitzar la biblioteca de connexió Drizzle!" #: libraries/config/Validator.class.php:267 #: libraries/config/Validator.class.php:278 #: libraries/config/Validator.class.php:285 -#, fuzzy #| msgid "Could not connect to the target" msgid "Could not connect to the database server!" -msgstr "No s'ha pogut connectar a la destinació" +msgstr "No s'ha pogut connectar amb el servidor de dades!" #: libraries/config/Validator.class.php:317 -#, fuzzy #| msgid "Empty username while using config authentication method" msgid "Empty username while using [kbd]config[/kbd] authentication method!" -msgstr "Nom d'usuari buit al usar el métode d'autenticació config" +msgstr "Nom d'usuari buit en usar el mètode d'autenticació [kbd]config[/kbd]!" #: libraries/config/Validator.class.php:324 -#, fuzzy #| msgid "Empty signon session name while using signon authentication method" msgid "" "Empty signon session name while using [kbd]signon[/kbd] authentication " "method!" -msgstr "Nom de sessió signon buit al usar el métode d'autenticació signon" +msgstr "" +"Nom de sessió signon buit en usar el mètode d'autenticació [kbd]signon[/kbd]!" #: libraries/config/Validator.class.php:333 #, fuzzy From a8d948895e5c8cf8d23d9ed43c1813e2cfe73f78 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sun, 5 Oct 2014 17:38:23 -0400 Subject: [PATCH 12/14] Fix code execution path warning Signed-off-by: Marc Delisle --- view_create.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/view_create.php b/view_create.php index 2c8a410793..b39ba7f60e 100644 --- a/view_create.php +++ b/view_create.php @@ -36,6 +36,8 @@ $view_security_options = array( 'INVOKER' ); +$sql_query = ''; + if (isset($_REQUEST['createview']) || isset($_REQUEST['alterview'])) { /** * Creates the view From 65f360b33f05a837fe4068768f23c4e28dbb8f1a Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Mon, 6 Oct 2014 10:20:47 +0530 Subject: [PATCH 13/14] bug #4551 Wrong test in source code Signed-off-by: Madhura Jayaratne --- ChangeLog | 1 + libraries/DisplayResults.class.php | 2 +- libraries/Util.class.php | 2 +- libraries/insert_edit.lib.php | 7 ++++--- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 78b1798f90..39f04b5c74 100644 --- a/ChangeLog +++ b/ChangeLog @@ -46,6 +46,7 @@ phpMyAdmin - ChangeLog + rfe #1546 Improve the js printf library + rfe #1542 Better error reporting in Designer - bug #4547 Micro history does not work in Users page +- bug #4551 Wrong test in source code 4.2.10.0 (not yet released) - bug #4361 Can't change font size (when config.inc.php not present) diff --git a/libraries/DisplayResults.class.php b/libraries/DisplayResults.class.php index e21468e7f4..09bdc17137 100644 --- a/libraries/DisplayResults.class.php +++ b/libraries/DisplayResults.class.php @@ -3972,7 +3972,7 @@ class PMA_DisplayResults || ($meta->type == self::DATETIME_FIELD) || ($meta->type == self::TIME_FIELD) || ($meta->type == self::TIME_FIELD)) - && ($pmaStr->strpos($column, ".") === true) + && ($pmaStr->strpos($column, ".") !== false) // micro seconds delimeter ) { $column = PMA_Util::addMicroseconds($column); } diff --git a/libraries/Util.class.php b/libraries/Util.class.php index f2e47076ef..c691ab6e1f 100644 --- a/libraries/Util.class.php +++ b/libraries/Util.class.php @@ -4423,7 +4423,7 @@ class PMA_Util return $value; } - if (!$pmaString->strpos($value, '.')) { + if ($pmaString->strpos($value, '.') === false) { return $value . '.000000'; } diff --git a/libraries/insert_edit.lib.php b/libraries/insert_edit.lib.php index 4cb8ba0aa7..324992654b 100644 --- a/libraries/insert_edit.lib.php +++ b/libraries/insert_edit.lib.php @@ -308,12 +308,12 @@ function PMA_getColumnTitle($column, $comments_map) /** * check whether the column is of a certain type * the goal is to ensure that types such as "enum('one','two','binary',..)" - * or "enum('one','two','varbinary',..)" are not categorized as binary + * or "enum('one','two','varbinary',..)" are not categorized as binary * * @param array $column description of column in given table * @param array $types the types to verify * - * @return boolean whether the column's type if one of the $types + * @return boolean whether the column's type if one of the $types */ function PMA_isColumn($column, $types) { @@ -1636,7 +1636,8 @@ function PMA_getSpecialCharsAndBackupFieldForExistingRow( } elseif (($pmaString->substr($column['True_Type'], 0, 9) == 'timestamp' || $column['True_Type'] == 'datetime' || $column['True_Type'] == 'time') - && ($pmaString->strpos($current_row[$column['Field']], ".") === true) + // micro seconds delimeter + && ($pmaString->strpos($current_row[$column['Field']], ".") !== false) ) { $current_row[$column['Field']] = $as_is ? $current_row[$column['Field']] From a0f6c46292e82ff2eb6e0e5f6c525f52d6bb0a34 Mon Sep 17 00:00:00 2001 From: Chanaka Dharmarathna Date: Mon, 6 Oct 2014 10:42:50 +0530 Subject: [PATCH 14/14] Remove dead codes Signed-off-by: Chanaka Dharmarathna --- libraries/TableSearch.class.php | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/libraries/TableSearch.class.php b/libraries/TableSearch.class.php index cb4febf8cd..0ba11bf645 100644 --- a/libraries/TableSearch.class.php +++ b/libraries/TableSearch.class.php @@ -258,13 +258,11 @@ class PMA_TableSearch * @param int $foreignMaxLimit Max limit of displaying foreign elements * @param array $criteriaValues Array of search criteria inputs * @param string $column_id Column's inputbox's id - * @param bool $in_zoom_search_edit Whether we are in zoom search edit * * @return string HTML elements. */ private function _getForeignKeyInputBox($foreignData, $column_name, - $column_index, $titles, $foreignMaxLimit, $criteriaValues, $column_id, - $in_zoom_search_edit = false + $column_index, $titles, $foreignMaxLimit, $criteriaValues, $column_id ) { $html_output = ''; if (is_array($foreignData['disp_row'])) { @@ -532,14 +530,13 @@ EOT; * @param mixed $criteriaValues Search criteria input * @param string $names Name of the column on which search is submitted * @param string $types Type of the field - * @param string $collations Field collation * @param string $func_type Search function/operator * @param bool $unaryFlag Whether operator unary or not * @param bool $geom_func Whether geometry functions should be applied * * @return string generated where clause. */ - private function _getWhereClause($criteriaValues, $names, $types, $collations, + private function _getWhereClause($criteriaValues, $names, $types, $func_type, $unaryFlag, $geom_func = null ) { // If geometry function is set @@ -705,14 +702,12 @@ EOT; } // else continue to form the where clause from column criteria values - $fullWhereClause = $charsets = array(); + $fullWhereClause = array(); reset($_POST['criteriaColumnOperators']); while (list($column_index, $operator) = each( $_POST['criteriaColumnOperators'] )) { - list($charsets[$column_index]) = explode( - '_', $_POST['criteriaColumnCollations'][$column_index] - ); + $unaryFlag = $GLOBALS['PMA_Types']->isUnaryOperator($operator); $tmp_geom_func = isset($geom_func[$column_index]) ? $geom_func[$column_index] : null; @@ -721,7 +716,6 @@ EOT; $_POST['criteriaValues'][$column_index], $_POST['criteriaColumnNames'][$column_index], $_POST['criteriaColumnTypes'][$column_index], - $_POST['criteriaColumnCollations'][$column_index], $operator, $unaryFlag, $tmp_geom_func