Skip to content

Commit

Permalink
fix parameter types
Browse files Browse the repository at this point in the history
Signed-off-by: Chirayu Chiripal <chirayu.chiripal@gmail.com>
  • Loading branch information
chirayuchiripal committed Aug 7, 2014
1 parent 8a2de5f commit 1be86d1
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 76 deletions.
54 changes: 27 additions & 27 deletions libraries/insert_edit.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -585,12 +585,12 @@ function PMA_getNullifyCodeForNullColumn($column, $foreigners, $foreignData)
* @param integer $tabindex tab index
* @param integer $tabindex_for_value offset for the values tabindex
* @param integer $idindex id index
* @param array $data description of the column field
* @param string $data description of the column field
* @param string $special_chars special characters
* @param array $foreignData data about the foreign keys
* @param boolean $odd_row whether row is odd
* @param array $paramTableDbArray array containing $table and $db
* @param array $rownumber the row number
* @param integer $rownumber the row number
* @param array $titles An HTML IMG tag for a particular icon from
* a theme, which may be an actual file or
* an icon from a sprite
Expand Down Expand Up @@ -711,9 +711,9 @@ function PMA_getValueColumn($column, $backup_field, $column_name_appendix,
* @param integer $tabindex tab index
* @param integer $tabindex_for_value offset for the values tabindex
* @param integer $idindex id index
* @param array $data data to edit
* @param string $data data to edit
* @param array $paramTableDbArray array containing $table and $db
* @param array $rownumber the row number
* @param integer $rownumber the row number
* @param array $titles An HTML IMG tag for a particular icon from
* a theme, which may be an actual file or
* an icon from a sprite
Expand Down Expand Up @@ -761,7 +761,7 @@ function PMA_getForeignLink($column, $backup_field, $column_name_appendix,
* @param integer $tabindex tab index
* @param integer $tabindex_for_value offset for the values tabindex
* @param integer $idindex id index
* @param array $data data to edit
* @param string $data data to edit
* @param array $foreignData data about the foreign keys
*
* @return string an html snippet
Expand Down Expand Up @@ -969,7 +969,7 @@ function PMA_getDropDownDependingOnLength(
* @param array $column description of column in given table
* @param integer $tabindex_for_value offset for the values tabindex
* @param integer $idindex id index
* @param array $data data to edit
* @param string $data data to edit
* @param array $column_enum_values $column['values']
*
* @return string an html snippet
Expand Down Expand Up @@ -1016,7 +1016,7 @@ function PMA_getRadioButtonDependingOnLength(
* @param integer $tabindex tab index
* @param integer $tabindex_for_value offset for the values tabindex
* @param integer $idindex id index
* @param array $data description of the column field
* @param string $data description of the column field
*
* @return string an html snippet
*/
Expand Down Expand Up @@ -1079,7 +1079,7 @@ function PMA_getColumnSetValueAndSelectSize($column, $extracted_columnspec)
* Get HTML for binary and blob column
*
* @param array $column description of column in given table
* @param array $data data to edit
* @param string $data data to edit
* @param string $special_chars special characters
* @param integer $biggest_max_file_size biggest max file size for uploading
* @param string $backup_field hidden input field
Expand Down Expand Up @@ -1674,7 +1674,7 @@ function PMA_getSpecialCharsAndBackupFieldForExistingRow(
$special_chars_encoded = '';
$data = null;
// (we are editing)
if (is_null($current_row[$column['Field']])) {
if (!isset($current_row[$column['Field']])) {
$real_null_value = true;
$current_row[$column['Field']] = '';
$special_chars = '';
Expand Down Expand Up @@ -2305,21 +2305,21 @@ function PMA_getQueryValuesForInsertAndUpdateInMultipleEdit($multi_edit_columns_
/**
* Get the current column value in the form for different data types
*
* @param string $possibly_uploaded_val uploaded file content
* @param string $key an md5 of the column name
* @param array $multi_edit_columns_type array of multi edit column types
* @param string $current_value current column value in the form
* @param array $multi_edit_auto_increment multi edit auto increment
* @param string $rownumber index of where clause array
* @param array $multi_edit_columns_name multi edit column names array
* @param array $multi_edit_columns_null multi edit columns null array
* @param array $multi_edit_columns_null_prev multi edit columns previous null
* @param boolean $is_insert whether insert or not
* @param boolean $using_key whether editing or new row
* @param array $where_clause where clauses
* @param string $table table name
*
* @return string $current_value current column value in the form
* @param string|false $possibly_uploaded_val uploaded file content
* @param string $key an md5 of the column name
* @param array $multi_edit_columns_type array of multi edit column types
* @param string $current_value current column value in the form
* @param array $multi_edit_auto_increment multi edit auto increment
* @param integer $rownumber index of where clause array
* @param array $multi_edit_columns_name multi edit column names array
* @param array $multi_edit_columns_null multi edit columns null array
* @param array $multi_edit_columns_null_prev multi edit columns previous null
* @param boolean $is_insert whether insert or not
* @param boolean $using_key whether editing or new row
* @param string $where_clause where clause
* @param string $table table name
*
* @return string $current_value current column value in the form
*/
function PMA_getCurrentValueForDifferentTypes($possibly_uploaded_val, $key,
$multi_edit_columns_type, $current_value, $multi_edit_auto_increment,
Expand All @@ -2329,7 +2329,7 @@ function PMA_getCurrentValueForDifferentTypes($possibly_uploaded_val, $key,
// Fetch the current values of a row to use in case we have a protected field
if ($is_insert
&& $using_key && isset($multi_edit_columns_type)
&& is_array($multi_edit_columns_type) && isset($where_clause)
&& is_array($multi_edit_columns_type) && !empty($where_clause)
) {
$protected_row = $GLOBALS['dbi']->fetchSingleRow(
'SELECT * FROM ' . PMA_Util::backquote($table)
Expand Down Expand Up @@ -2732,7 +2732,7 @@ function PMA_getHtmlForInsertEditFormColumn($table_columns, $i, $column,
);
}
$as_is = false;
if (!empty($repopulate) && isset($current_row)) {
if (!empty($repopulate) && !empty($current_row)) {
$current_row[$column['Field']] = $repopulate[$column['Field_md5']];
$as_is = true;
}
Expand Down Expand Up @@ -2779,7 +2779,7 @@ function PMA_getHtmlForInsertEditFormColumn($table_columns, $i, $column,
// Prepares the field value
$real_null_value = false;
$special_chars_encoded = '';
if (isset($current_row)) {
if (!empty($current_row)) {
// (we are editing)
list(
$real_null_value, $special_chars_encoded, $special_chars,
Expand Down
6 changes: 3 additions & 3 deletions tbl_change.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@

$GLOBALS['plugin_scripts'] = array();
foreach ($rows as $row_id => $current_row) {
if ($current_row === false) {
unset($current_row);
if (empty($current_row)) {
$current_row = array();
}

$jsvkey = $row_id;
Expand All @@ -188,7 +188,7 @@
$html_output .= PMA_getHtmlForInsertEditRow(
$url_params, $table_columns, $column, $comments_map, $timestamp_seen,
$current_result, $chg_evt_handler, $jsvkey, $vkey, $insert_mode,
isset($current_row) ? $current_row : null, $o_rows, $tabindex, $columns_cnt,
$current_row, $o_rows, $tabindex, $columns_cnt,
$is_upload, $tabindex_for_function, $foreigners, $tabindex_for_null,
$tabindex_for_value, $table, $db, $row_id, $titles,
$biggest_max_file_size, $text_dir, $repopulate, $where_clause_array
Expand Down
Loading

0 comments on commit 1be86d1

Please sign in to comment.