removed PMA_isInto(), deprecated by in_array()
This commit is contained in:
@@ -85,7 +85,7 @@ if (isset($submit_search)) {
|
|||||||
for ($i = 0; $i < $search_wds_cnt; $i++) {
|
for ($i = 0; $i < $search_wds_cnt; $i++) {
|
||||||
// Eliminates empty values
|
// Eliminates empty values
|
||||||
// In MySQL 4.1, if a field has no collation we get NULL in Charset
|
// 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])) {
|
if (!empty($search_words[$i])) {
|
||||||
for ($j = 0; $j < $tblfields_cnt; $j++) {
|
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'] != '') {
|
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)) {
|
if (!empty($unselectall)) {
|
||||||
$is_selected = '';
|
$is_selected = '';
|
||||||
}
|
}
|
||||||
else if ((isset($table_select) && PMA_isInto($tables[$i], $table_select) != -1)
|
elseif ( ( isset($table_select) && in_array($tables[$i], $table_select) )
|
||||||
|| (!empty($selectall))
|
|| ! empty($selectall)
|
||||||
|| (isset($onetable) && $onetable == $tables[$i])) {
|
|| ( isset($onetable) && $onetable == $tables[$i]) ) {
|
||||||
$is_selected = ' selected="selected"';
|
$is_selected = ' selected="selected"';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@@ -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);
|
$rs = PMA_DBI_try_query($local_query, $controllink);
|
||||||
if ($rs && @PMA_DBI_num_rows($rs)) {
|
if ($rs && @PMA_DBI_num_rows($rs)) {
|
||||||
while ($row = PMA_DBI_fetch_assoc($rs)) {
|
while ($row = PMA_DBI_fetch_assoc($rs)) {
|
||||||
if (PMA_isInto($row['Db'], $dblist) == -1) {
|
if ( ! in_array($row['Db'], $dblist) ) {
|
||||||
$dblist[] = $row['Db'];
|
$dblist[] = $row['Db'];
|
||||||
}
|
}
|
||||||
} // end while
|
} // end while
|
||||||
@@ -812,15 +812,15 @@ if ( ! defined( 'PMA_MINIMUM_COMMON' ) ) {
|
|||||||
// get the duplicate entry
|
// get the duplicate entry
|
||||||
|
|
||||||
// get table name
|
// get table name
|
||||||
preg_match( '<27>ALTER\sTABLE\s\`([^\`]+)\`<60>iu', $the_query, $error_table = array() );
|
preg_match( '<27>ALTER\sTABLE\s\`([^\`]+)\`<60>iu', $the_query, $error_table = array() );
|
||||||
$error_table = $error_table[1];
|
$error_table = $error_table[1];
|
||||||
|
|
||||||
// get fields
|
// get fields
|
||||||
preg_match( '<27>\(([^\)]+)\)<29>i', $the_query, $error_fields = array() );
|
preg_match( '<27>\(([^\)]+)\)<29>i', $the_query, $error_fields = array() );
|
||||||
$error_fields = explode( ',', $error_fields[1] );
|
$error_fields = explode( ',', $error_fields[1] );
|
||||||
|
|
||||||
// duplicate value
|
// duplicate value
|
||||||
preg_match( '<27>\'([^\']+)\'<27>i', $tmp_mysql_error, $duplicate_value = array() );
|
preg_match( '<27>\'([^\']+)\'<27>i', $tmp_mysql_error, $duplicate_value = array() );
|
||||||
$duplicate_value = $duplicate_value[1];
|
$duplicate_value = $duplicate_value[1];
|
||||||
|
|
||||||
$sql = '
|
$sql = '
|
||||||
@@ -852,29 +852,6 @@ if ( ! defined( 'PMA_MINIMUM_COMMON' ) ) {
|
|||||||
}
|
}
|
||||||
} // end of the 'PMA_mysqlDie()' function
|
} // 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
|
* Returns a string formatted with CONVERT ... USING
|
||||||
* if MySQL supports it
|
* 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 . ' '
|
$ret .= '<input type="image"' . $submit_name . ' '
|
||||||
. implode( ' ', $tag_params_strings )
|
. implode( ' ', $tag_params_strings )
|
||||||
. ' src="' . preg_replace(
|
. ' src="' . preg_replace(
|
||||||
'<27>^.*\ssrc="([^"]*)".*$<24>si', '\1', $message ) . '"'
|
'<27>^.*\ssrc="([^"]*)".*$<24>si', '\1', $message ) . '"'
|
||||||
. ' value="' . htmlspecialchars(
|
. ' value="' . htmlspecialchars(
|
||||||
preg_replace( '<27>^.*\salt="([^"]*)".*$<24>si', '\1',
|
preg_replace( '<27>^.*\salt="([^"]*)".*$<24>si', '\1',
|
||||||
$message) )
|
$message) )
|
||||||
. '" />';
|
. '" />';
|
||||||
}
|
}
|
||||||
|
@@ -91,8 +91,8 @@ function PMA_table_move_copy($source_db, $source_table, $target_db, $target_tabl
|
|||||||
$GLOBALS['asfile'] = 1;
|
$GLOBALS['asfile'] = 1;
|
||||||
|
|
||||||
// Ensure the target is valid
|
// Ensure the target is valid
|
||||||
if (count($dblist) > 0 &&
|
if ( count($dblist) > 0 &&
|
||||||
(PMA_isInto($source_db, $dblist) == -1 || PMA_isInto($target_db, $dblist) == -1)) {
|
( ! in_array($source_db, $dblist) || ! in_array($target_db, $dblist) )) {
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -290,7 +290,7 @@ class PMA_PDF extends PMA_FPDF
|
|||||||
echo "\n";
|
echo "\n";
|
||||||
|
|
||||||
require_once('./libraries/footer.inc.php');
|
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
|
// loic1 : PHP3 fix
|
||||||
// if (in_array($field, $this->primary)) {
|
// if (in_array($field, $this->primary)) {
|
||||||
if ($setcolor) {
|
if ($setcolor) {
|
||||||
if (PMA_isInto($field, $this->primary) != -1) {
|
if ( in_array($field, $this->primary) ) {
|
||||||
$pdf->SetFillColor(215, 121, 123);
|
$pdf->SetFillColor(215, 121, 123);
|
||||||
}
|
}
|
||||||
if ($field == $this->displayfield) {
|
if ($field == $this->displayfield) {
|
||||||
@@ -1200,7 +1200,7 @@ class PMA_RT
|
|||||||
// (do not use array_search() because we would have to
|
// (do not use array_search() because we would have to
|
||||||
// to do a === FALSE and this is not PHP3 compatible)
|
// 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']);
|
$this->PMA_RT_addRelation($one_table , $master_field, $rel['foreign_table'], $rel['foreign_field']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user