diff options
-rw-r--r-- | db_search.php | 8 | ||||
-rw-r--r-- | libraries/common.lib.php | 35 | ||||
-rw-r--r-- | libraries/tbl_move_copy.php | 4 | ||||
-rw-r--r-- | pdf_schema.php | 6 |
4 files changed, 15 insertions, 38 deletions
diff --git a/db_search.php b/db_search.php index 39059a881a..67bf626463 100644 --- a/db_search.php +++ b/db_search.php @@ -85,7 +85,7 @@ if (isset($submit_search)) { for ($i = 0; $i < $search_wds_cnt; $i++) { // Eliminates empty values // In MySQL 4.1, if a field has no collation we get NULL in Charset - // but in MySQL 5.0.x we get '' + // but in MySQL 5.0.x we get '' if (!empty($search_words[$i])) { for ($j = 0; $j < $tblfields_cnt; $j++) { if (PMA_MYSQL_INT_VERSION >= 40100 && $tblfields[$j]['Charset'] != $charset_connection && $tblfields[$j]['Charset'] != 'NULL' && $tblfields[$j]['Charset'] != '') { @@ -323,9 +323,9 @@ if ($num_tables > 1) { if (!empty($unselectall)) { $is_selected = ''; } - else if ((isset($table_select) && PMA_isInto($tables[$i], $table_select) != -1) - || (!empty($selectall)) - || (isset($onetable) && $onetable == $tables[$i])) { + elseif ( ( isset($table_select) && in_array($tables[$i], $table_select) ) + || ! empty($selectall) + || ( isset($onetable) && $onetable == $tables[$i]) ) { $is_selected = ' selected="selected"'; } else { diff --git a/libraries/common.lib.php b/libraries/common.lib.php index 1b1bdbf260..df7abe9160 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -297,7 +297,7 @@ function PMA_safe_db_list($only_db_check, $controllink, $dblist_cnt, $rs, $userl $rs = PMA_DBI_try_query($local_query, $controllink); if ($rs && @PMA_DBI_num_rows($rs)) { while ($row = PMA_DBI_fetch_assoc($rs)) { - if (PMA_isInto($row['Db'], $dblist) == -1) { + if ( ! in_array($row['Db'], $dblist) ) { $dblist[] = $row['Db']; } } // end while @@ -812,15 +812,15 @@ if ( ! defined( 'PMA_MINIMUM_COMMON' ) ) { // get the duplicate entry // get table name - preg_match( '°ALTER\sTABLE\s\`([^\`]+)\`°iu', $the_query, $error_table = array() ); + preg_match( '�ALTER\sTABLE\s\`([^\`]+)\`�iu', $the_query, $error_table = array() ); $error_table = $error_table[1]; // get fields - preg_match( '°\(([^\)]+)\)°i', $the_query, $error_fields = array() ); + preg_match( '�\(([^\)]+)\)�i', $the_query, $error_fields = array() ); $error_fields = explode( ',', $error_fields[1] ); // duplicate value - preg_match( '°\'([^\']+)\'°i', $tmp_mysql_error, $duplicate_value = array() ); + preg_match( '�\'([^\']+)\'�i', $tmp_mysql_error, $duplicate_value = array() ); $duplicate_value = $duplicate_value[1]; $sql = ' @@ -852,29 +852,6 @@ if ( ! defined( 'PMA_MINIMUM_COMMON' ) ) { } } // end of the 'PMA_mysqlDie()' function - - /** - * Defines whether a string exists inside an array or not - * - * @param string string to search for - * @param mixed array to search into - * - * @return integer the rank of the $toFind string in the array or '-1' if - * it hasn't been found - * - * @access public - */ - function PMA_isInto($toFind = '', &$in) - { - $max = count($in); - for ($i = 0; $i < $max && ($toFind != $in[$i]); $i++) { - // void(); - } - - return ($i < $max) ? $i : -1; - } // end of the 'PMA_isInto()' function - - /** * Returns a string formatted with CONVERT ... USING * if MySQL supports it @@ -1954,9 +1931,9 @@ window.parent.updateTableTitle( '<?php echo $uni_tbl; ?>', '<?php echo PMA_jsFor $ret .= '<input type="image"' . $submit_name . ' ' . implode( ' ', $tag_params_strings ) . ' src="' . preg_replace( - '°^.*\ssrc="([^"]*)".*$°si', '\1', $message ) . '"' + '�^.*\ssrc="([^"]*)".*$�si', '\1', $message ) . '"' . ' value="' . htmlspecialchars( - preg_replace( '°^.*\salt="([^"]*)".*$°si', '\1', + preg_replace( '�^.*\salt="([^"]*)".*$�si', '\1', $message) ) . '" />'; } diff --git a/libraries/tbl_move_copy.php b/libraries/tbl_move_copy.php index f2d1af1c0a..01f143412d 100644 --- a/libraries/tbl_move_copy.php +++ b/libraries/tbl_move_copy.php @@ -91,8 +91,8 @@ function PMA_table_move_copy($source_db, $source_table, $target_db, $target_tabl $GLOBALS['asfile'] = 1; // Ensure the target is valid - if (count($dblist) > 0 && - (PMA_isInto($source_db, $dblist) == -1 || PMA_isInto($target_db, $dblist) == -1)) { + if ( count($dblist) > 0 && + ( ! in_array($source_db, $dblist) || ! in_array($target_db, $dblist) )) { exit(); } diff --git a/pdf_schema.php b/pdf_schema.php index 940d0de4e6..9f106b7fd4 100644 --- a/pdf_schema.php +++ b/pdf_schema.php @@ -290,7 +290,7 @@ class PMA_PDF extends PMA_FPDF echo "\n"; require_once('./libraries/footer.inc.php'); - } // end of the "PMA_PDF_die()" function + } // end of the "PMA_PDF_die()" function /** @@ -645,7 +645,7 @@ class PMA_RT_Table // loic1 : PHP3 fix // if (in_array($field, $this->primary)) { if ($setcolor) { - if (PMA_isInto($field, $this->primary) != -1) { + if ( in_array($field, $this->primary) ) { $pdf->SetFillColor(215, 121, 123); } if ($field == $this->displayfield) { @@ -1200,7 +1200,7 @@ class PMA_RT // (do not use array_search() because we would have to // to do a === FALSE and this is not PHP3 compatible) - if (PMA_isInto($rel['foreign_table'], $alltables)> -1) { + if ( in_array($rel['foreign_table'], $alltables) ) { $this->PMA_RT_addRelation($one_table , $master_field, $rel['foreign_table'], $rel['foreign_field']); } |