removed PMA_isInto(), deprecated by in_array()
This commit is contained in:
@@ -323,8 +323,8 @@ if ($num_tables > 1) {
|
||||
if (!empty($unselectall)) {
|
||||
$is_selected = '';
|
||||
}
|
||||
else if ((isset($table_select) && PMA_isInto($tables[$i], $table_select) != -1)
|
||||
|| (!empty($selectall))
|
||||
elseif ( ( isset($table_select) && in_array($tables[$i], $table_select) )
|
||||
|| ! empty($selectall)
|
||||
|| ( isset($onetable) && $onetable == $tables[$i]) ) {
|
||||
$is_selected = ' selected="selected"';
|
||||
}
|
||||
|
@@ -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( '<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];
|
||||
|
||||
// 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] );
|
||||
|
||||
// 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];
|
||||
|
||||
$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(
|
||||
'<27>^.*\ssrc="([^"]*)".*$<24>si', '\1', $message ) . '"'
|
||||
'<27>^.*\ssrc="([^"]*)".*$<24>si', '\1', $message ) . '"'
|
||||
. ' value="' . htmlspecialchars(
|
||||
preg_replace( '<27>^.*\salt="([^"]*)".*$<24>si', '\1',
|
||||
preg_replace( '<27>^.*\salt="([^"]*)".*$<24>si', '\1',
|
||||
$message) )
|
||||
. '" />';
|
||||
}
|
||||
|
@@ -92,7 +92,7 @@ function PMA_table_move_copy($source_db, $source_table, $target_db, $target_tabl
|
||||
|
||||
// Ensure the target is valid
|
||||
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();
|
||||
}
|
||||
|
||||
|
@@ -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']);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user