Merge remote-tracking branch 'origin/QA_4_2' into QA_4_2

This commit is contained in:
Weblate 2014-06-22 16:35:36 +02:00
commit 6fdf5e6551
43 changed files with 298 additions and 287 deletions

View File

@ -287,7 +287,7 @@ if ($cfgRelation['pdfwork'] && $num_tables > 0) {
WHERE db_name = \'' . PMA_Util::sqlAddSlashes($db) . '\'';
$test_rs = PMA_queryAsControlUser(
$test_query,
null,
false,
PMA_DatabaseInterface::QUERY_STORE
);

View File

@ -100,7 +100,7 @@ if ($GLOBALS['is_ajax_request'] && ! empty($_REQUEST['favorite_table'])) {
$ajax_response->addJSON(
'anchor',
PMA_getHtmlForFavoriteAnchor(
$db, array('TABLE_NAME' => $favorite_table), $titles
$db, $favorite_table, $titles
)
);
} else {

View File

@ -64,7 +64,7 @@ function Show_page($contents)
}
/* Need to have cookie visible from parent directory */
session_set_cookie_params(0, '/', '', 0);
session_set_cookie_params(0, '/', '', false);
/* Create signon session */
$session_name = 'SignonSession';
session_name($session_name);

View File

@ -12,7 +12,7 @@
*/
/* Need to have cookie visible from parent directory */
session_set_cookie_params(0, '/', '', 0);
session_set_cookie_params(0, '/', '', false);
/* Create signon session */
$session_name = 'SignonSession';
session_name($session_name);

View File

@ -624,7 +624,7 @@ if (strlen($sql_query) <= $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']) {
if (isset($my_die)) {
foreach ($my_die as $key => $die) {
PMA_Util::mysqlDie(
$die['error'], $die['sql'], '', $err_url, $error
$die['error'], $die['sql'], false, $err_url, $error
);
}
}

View File

@ -187,7 +187,7 @@ class Advisor
/**
* Splits justification to text and formula.
*
* @param string $rule the rule
* @param array $rule the rule
*
* @return array
*/
@ -204,7 +204,7 @@ class Advisor
* Adds a rule to the result list
*
* @param string $type type of rule
* @param array $rule rule itslef
* @param array $rule rule itself
*
* @return void
*/

View File

@ -118,7 +118,7 @@ class PMA_DbQbe
* Minimum width of a column
*
* @access private
* @var string
* @var int
*/
private $_form_column_width;
/**
@ -1313,7 +1313,7 @@ class PMA_DbQbe
/**
* Provides FROM clause for building SQL query
*
* @param string $cfgRelation Relation Settings
* @param array $cfgRelation Relation Settings
*
* @return string FROM clause
*/
@ -1362,7 +1362,7 @@ class PMA_DbQbe
/**
* Provides the generated SQL query
*
* @param string $cfgRelation Relation Settings
* @param array $cfgRelation Relation Settings
*
* @return string SQL query
*/
@ -1386,7 +1386,7 @@ class PMA_DbQbe
/**
* Provides the generated QBE form
*
* @param string $cfgRelation Relation Settings
* @param array $cfgRelation Relation Settings
*
* @return string QBE form
*/

View File

@ -366,7 +366,7 @@ class PMA_DatabaseInterface
/**
* returns the beginning of the SQL statement to fetch the list of tables
*
* @param string $this_databases databases to list
* @param array $this_databases databases to list
* @param string $sql_where_table additional condition
*
* @return string the SQL statement
@ -374,7 +374,7 @@ class PMA_DatabaseInterface
private function _getSqlForTablesFull($this_databases, $sql_where_table)
{
if (PMA_DRIZZLE) {
$engine_info = PMA_Util::cacheGet('drizzle_engines', true);
$engine_info = PMA_Util::cacheGet('drizzle_engines', null);
$stats_join = "LEFT JOIN (SELECT 0 NUM_ROWS) AS stat ON false";
if (isset($engine_info['InnoDB'])
&& $engine_info['InnoDB']['module_library'] == 'innobase'
@ -893,7 +893,7 @@ class PMA_DatabaseInterface
$sql .= '
FROM data_dictionary.SCHEMAS s';
if ($force_stats) {
$engine_info = PMA_Util::cacheGet('drizzle_engines', true);
$engine_info = PMA_Util::cacheGet('drizzle_engines', null);
$stats_join = "LEFT JOIN (SELECT 0 NUM_ROWS) AS stat ON false";
if (isset($engine_info['InnoDB'])
&& $engine_info['InnoDB']['module_library'] == 'innobase'
@ -1386,26 +1386,26 @@ class PMA_DatabaseInterface
return;
}
if (! defined('PMA_MYSQL_INT_VERSION')) {
if (PMA_Util::cacheExists('PMA_MYSQL_INT_VERSION', true)) {
if (PMA_Util::cacheExists('PMA_MYSQL_INT_VERSION', null)) {
define(
'PMA_MYSQL_INT_VERSION',
PMA_Util::cacheGet('PMA_MYSQL_INT_VERSION', true)
PMA_Util::cacheGet('PMA_MYSQL_INT_VERSION', null)
);
define(
'PMA_MYSQL_MAJOR_VERSION',
PMA_Util::cacheGet('PMA_MYSQL_MAJOR_VERSION', true)
PMA_Util::cacheGet('PMA_MYSQL_MAJOR_VERSION', null)
);
define(
'PMA_MYSQL_STR_VERSION',
PMA_Util::cacheGet('PMA_MYSQL_STR_VERSION', true)
PMA_Util::cacheGet('PMA_MYSQL_STR_VERSION', null)
);
define(
'PMA_MYSQL_VERSION_COMMENT',
PMA_Util::cacheGet('PMA_MYSQL_VERSION_COMMENT', true)
PMA_Util::cacheGet('PMA_MYSQL_VERSION_COMMENT', null)
);
define(
'PMA_DRIZZLE',
PMA_Util::cacheGet('PMA_DRIZZLE', true)
PMA_Util::cacheGet('PMA_DRIZZLE', null)
);
} else {
$version = $this->fetchSingleRow(
@ -1437,22 +1437,22 @@ class PMA_DatabaseInterface
PMA_Util::cacheSet(
'PMA_MYSQL_INT_VERSION',
PMA_MYSQL_INT_VERSION,
true
null
);
PMA_Util::cacheSet(
'PMA_MYSQL_MAJOR_VERSION',
PMA_MYSQL_MAJOR_VERSION,
true
null
);
PMA_Util::cacheSet(
'PMA_MYSQL_STR_VERSION',
PMA_MYSQL_STR_VERSION,
true
null
);
PMA_Util::cacheSet(
'PMA_MYSQL_VERSION_COMMENT',
PMA_MYSQL_VERSION_COMMENT,
true
null
);
/* Detect Drizzle - it does not support charsets */
@ -1470,7 +1470,7 @@ class PMA_DatabaseInterface
PMA_Util::cacheSet(
'PMA_DRIZZLE',
PMA_DRIZZLE,
true
null
);
}
}
@ -1516,7 +1516,7 @@ class PMA_DatabaseInterface
}
// Cache plugin list for Drizzle
if (PMA_DRIZZLE && !PMA_Util::cacheExists('drizzle_engines', true)) {
if (PMA_DRIZZLE && !PMA_Util::cacheExists('drizzle_engines', null)) {
$sql = "SELECT p.plugin_name, m.module_library
FROM data_dictionary.plugins p
JOIN data_dictionary.modules m USING (module_name)
@ -1524,7 +1524,7 @@ class PMA_DatabaseInterface
AND p.plugin_name NOT IN ('FunctionEngine', 'schema')
AND p.is_active = 'YES'";
$engines = $this->fetchResult($sql, 'plugin_name', null, $link);
PMA_Util::cacheSet('drizzle_engines', $engines, true);
PMA_Util::cacheSet('drizzle_engines', $engines, null);
}
}
@ -1686,13 +1686,13 @@ class PMA_DatabaseInterface
* // $users['admin']['John Doe'] = '123'
* </code>
*
* @param string|mysql_result $result query or mysql result
* @param string|integer $key field-name or offset
* used as key for array
* @param string|integer $value value-name or offset
* used as value for array
* @param resource $link mysql link
* @param mixed $options query options
* @param string|mysql_result $result query or mysql result
* @param string|integer|array $key field-name or offset
* used as key for array
* @param string|integer $value value-name or offset
* used as value for array
* @param resource $link mysql link
* @param mixed $options query options
*
* @return array resultrows or values indexed by $key
*/
@ -2010,8 +2010,8 @@ class PMA_DatabaseInterface
*/
public function isSuperuser()
{
if (PMA_Util::cacheExists('is_superuser', true)) {
return PMA_Util::cacheGet('is_superuser', true);
if (PMA_Util::cacheExists('is_superuser', null)) {
return PMA_Util::cacheGet('is_superuser', null);
}
// when connection failed we don't have a $userlink
@ -2031,12 +2031,12 @@ class PMA_DatabaseInterface
self::QUERY_STORE
);
}
PMA_Util::cacheSet('is_superuser', $result, true);
PMA_Util::cacheSet('is_superuser', $result, null);
} else {
PMA_Util::cacheSet('is_superuser', false, true);
PMA_Util::cacheSet('is_superuser', false, null);
}
return PMA_Util::cacheGet('is_superuser', true);
return PMA_Util::cacheGet('is_superuser', null);
}
/**

View File

@ -990,10 +990,10 @@ class PMA_DisplayResults
*
* @param array &$is_display which elements to display
* @param array|string $analyzed_sql the analyzed query
* @param string $sort_expression sort expression
* @param string $sort_expression_nodirection sort expression
* @param array $sort_expression sort expression
* @param array $sort_expression_nodirection sort expression
* without direction
* @param string $sort_direction sort direction
* @param array $sort_direction sort direction
* @param boolean $is_limited_display with limited operations
* or not
*
@ -1827,7 +1827,7 @@ class PMA_DisplayResults
* @param integer $column_index the index of the column
* @param string $unsorted_sql_query the unsorted sql query
* @param integer $session_max_rows maximum rows resulted by sql
* @param array $direction the display direction
* @param string $direction the display direction
* @param string $comments comment for row
* @param array $sort_direction sort direction
* @param boolean $directionCondition display direction horizontal
@ -2094,7 +2094,7 @@ class PMA_DisplayResults
* Get sort url paramaeters - sort order and order image
*
* @param array $sort_direction the sort direction
* @param array $sort_order the sorting order
* @param string $sort_order the sorting order
* @param integer $column_index the index of the column
* @param integer $index the index of sort direction array.
*
@ -3685,7 +3685,7 @@ class PMA_DisplayResults
* @param array $analyzed_sql the analyzed query
* @param string $transformation_plugin the name of transformation plugin
* @param string $default_function the default transformation function
* @param string $transform_options the transformation parameters
* @param array $transform_options the transformation parameters
*
* @return string $cell the prepared cell, html content
*
@ -3741,7 +3741,7 @@ class PMA_DisplayResults
* primary etc)
* @param string $transformation_plugin the name of transformation function
* @param string $default_function the default transformation function
* @param string $transform_options the transformation parameters
* @param array $transform_options the transformation parameters
* @param boolean $condition_field the column should highlighted
* or not
* @param boolean $is_field_truncated the condition for blob data
@ -3839,7 +3839,7 @@ class PMA_DisplayResults
* @param boolean $condition_field the column should highlighted or not
* @param string $transformation_plugin the name of transformation function
* @param string $default_function the default transformation function
* @param string $transform_options the transformation parameters
* @param array $transform_options the transformation parameters
* @param boolean $is_field_truncated the condition for blob data replacements
* @param array $analyzed_sql the analyzed query
*
@ -3960,7 +3960,7 @@ class PMA_DisplayResults
* or not
* @param string $transformation_plugin the name of transformation function
* @param string $default_function the default transformation function
* @param string $transform_options the transformation parameters
* @param array $transform_options the transformation parameters
* @param boolean $is_field_truncated the condition for blob data
* replacements
* @param array $analyzed_sql the analyzed query
@ -4907,7 +4907,7 @@ class PMA_DisplayResults
$column_for_first_row = $this->_handleNonPrintableContents(
$meta->type, $row[$sorted_column_index],
$transformation_plugin, $transform_options,
$default_function, $meta, null
$default_function, $meta
);
} else {
@ -4931,7 +4931,7 @@ class PMA_DisplayResults
$column_for_last_row = $this->_handleNonPrintableContents(
$meta->type, $row[$sorted_column_index],
$transformation_plugin, $transform_options,
$default_function, $meta, null
$default_function, $meta
);
} else {
@ -5521,7 +5521,7 @@ class PMA_DisplayResults
* @param string $transformation_plugin transformation plugin.
* Can also be the default function:
* PMA_mimeDefaultFunction
* @param string $transform_options transformation parameters
* @param array $transform_options transformation parameters
* @param string $default_function default transformation function
* @param object $meta the meta-information about the field
* @param array $url_params parameters that should go to the
@ -5606,7 +5606,7 @@ class PMA_DisplayResults
* @param string $class css classes for the td element
* @param bool $condition_field whether the column is a part of the
* where clause
* @param string $analyzed_sql the analyzed query
* @param array $analyzed_sql the analyzed query
* @param object $meta the meta-information about the field
* @param array $map the list of relations
* @param string $data data

View File

@ -572,7 +572,7 @@ class PMA_File
/**
* Sets the file handle
*
* @param object $handle file handle
* @param resource $handle file handle
*
* @return void
*/
@ -630,7 +630,7 @@ class PMA_File
include_once './libraries/zip_extension.lib.php';
$result = PMA_getZipContents($this->getName());
if (! empty($result['error'])) {
$this->_error_message = PMA_Message::rawError($result['error']);
$this->_error_message = (string) PMA_Message::rawError($result['error']);
return false;
} else {
$this->content_uncompressed = $result['data'];

View File

@ -138,11 +138,11 @@ class PMA_Message
/**
* Constructor
*
* @param string $string The message to be displayed
* @param integer $number A numeric representation of the type of message
* @param array $params An array of parameters to use in the message
* @param integer $sanitize A flag to indicate what to sanitize, see
* constant definitions above
* @param string $string The message to be displayed
* @param integer $number A numeric representation of the type of message
* @param array|string $params An array of parameters to use in the message
* @param integer $sanitize A flag to indicate what to sanitize, see
* constant definitions above
*/
public function __construct($string = '', $number = PMA_Message::NOTICE,
$params = array(), $sanitize = PMA_Message::SANITIZE_NONE
@ -515,8 +515,8 @@ class PMA_Message
/**
* set all params at once, usually used in conjunction with string
*
* @param array $params parameters to set
* @param boolean $sanitize whether to sanitize params
* @param array|string $params parameters to set
* @param boolean $sanitize whether to sanitize params
*
* @return void
*/
@ -525,6 +525,10 @@ class PMA_Message
if ($sanitize) {
$params = PMA_Message::sanitize($params);
}
// convert single param to array
if (! is_array($params)) {
$params = array($params);
}
$this->params = $params;
}

View File

@ -20,6 +20,8 @@ require_once './libraries/List_Database.class.php';
* phpMyAdmin main Controller
*
* @package PhpMyAdmin
* @property resource $userlink
* @property resource $controllink
*/
class PMA
{

View File

@ -488,11 +488,12 @@ class PMA_Table
}
break;
case 'NULL' :
//If user uncheck null checkbox and not change default value null,
//default value will be ignored.
if ($null !== false && $null != 'NULL') {
// If user uncheck null checkbox and not change default value null,
// default value will be ignored.
if ($null !== false && $null !== 'NULL') {
break;
}
// otherwise, fall to next case (no break; here)
case 'CURRENT_TIMESTAMP' :
$query .= ' DEFAULT ' . $default_type;
break;

View File

@ -1307,7 +1307,7 @@ class PMA_Util
*/
public static function profilingSupported()
{
if (!self::cacheExists('profiling_supported', true)) {
if (!self::cacheExists('profiling_supported', null)) {
// 5.0.37 has profiling but for example, 5.1.20 does not
// (avoid a trip to the server for MySQL before 5.0.37)
// and do not set a constant as we might be switching servers
@ -1315,13 +1315,13 @@ class PMA_Util
&& (PMA_MYSQL_INT_VERSION >= 50037)
&& $GLOBALS['dbi']->fetchValue("SHOW VARIABLES LIKE 'profiling'")
) {
self::cacheSet('profiling_supported', true, true);
self::cacheSet('profiling_supported', true, null);
} else {
self::cacheSet('profiling_supported', false, true);
self::cacheSet('profiling_supported', false, null);
}
}
return self::cacheGet('profiling_supported', true);
return self::cacheGet('profiling_supported', null);
}
/**
@ -2801,20 +2801,20 @@ class PMA_Util
*/
public static function clearUserCache()
{
self::cacheUnset('is_superuser', true);
self::cacheUnset('is_superuser', null);
}
/**
* Verifies if something is cached in the session
*
* @param string $var variable name
* @param int|true $server server
* @param null|int $server server
*
* @return boolean
*/
public static function cacheExists($var, $server = 0)
{
if ($server === true) {
if ($server === null) {
$server = $GLOBALS['server'];
}
return isset($_SESSION['cache']['server_' . $server][$var]);
@ -2824,13 +2824,13 @@ class PMA_Util
* Gets cached information from the session
*
* @param string $var varibale name
* @param int|true $server server
* @param null|int $server server
*
* @return mixed
*/
public static function cacheGet($var, $server = 0)
{
if ($server === true) {
if ($server === null) {
$server = $GLOBALS['server'];
}
if (isset($_SESSION['cache']['server_' . $server][$var])) {
@ -2845,13 +2845,13 @@ class PMA_Util
*
* @param string $var variable name
* @param mixed $val value
* @param int|true $server server
* @param null|int $server server
*
* @return mixed
*/
public static function cacheSet($var, $val = null, $server = 0)
{
if ($server === true) {
if ($server === null) {
$server = $GLOBALS['server'];
}
$_SESSION['cache']['server_' . $server][$var] = $val;
@ -2861,13 +2861,13 @@ class PMA_Util
* Removes cached information from the session
*
* @param string $var variable name
* @param int|true $server server
* @param null|int $server server
*
* @return void
*/
public static function cacheUnset($var, $server = 0)
{
if ($server === true) {
if ($server === null) {
$server = $GLOBALS['server'];
}
unset($_SESSION['cache']['server_' . $server][$var]);
@ -4264,10 +4264,10 @@ class PMA_Util
&& $save
) {
if (! isset($_SESSION) && ! defined('TESTSUITE')) {
ini_set('session.use_only_cookies', false);
ini_set('session.use_cookies', false);
ini_set('session.use_trans_sid', false);
ini_set('session.cache_limiter', null);
ini_set('session.use_only_cookies', '0');
ini_set('session.use_cookies', '0');
ini_set('session.use_trans_sid', '0');
ini_set('session.cache_limiter', 'null');
session_start();
}
$_SESSION['cache']['version_check'] = array(

View File

@ -34,21 +34,21 @@ $GLOBALS['is_superuser'] = $GLOBALS['dbi']->isSuperuser();
*/
function PMA_analyseShowGrant()
{
if (PMA_Util::cacheExists('is_create_db_priv', true)) {
if (PMA_Util::cacheExists('is_create_db_priv', null)) {
$GLOBALS['is_create_db_priv'] = PMA_Util::cacheGet(
'is_create_db_priv', true
'is_create_db_priv', null
);
$GLOBALS['is_process_priv'] = PMA_Util::cacheGet(
'is_process_priv', true
'is_process_priv', null
);
$GLOBALS['is_reload_priv'] = PMA_Util::cacheGet(
'is_reload_priv', true
'is_reload_priv', null
);
$GLOBALS['db_to_create'] = PMA_Util::cacheGet(
'db_to_create', true
'db_to_create', null
);
$GLOBALS['dbs_where_create_table_allowed'] = PMA_Util::cacheGet(
'dbs_where_create_table_allowed', true
'dbs_where_create_table_allowed', null
);
return;
}
@ -152,14 +152,14 @@ function PMA_analyseShowGrant()
// must also cacheUnset() them in
// libraries/plugins/auth/AuthenticationCookie.class.php
PMA_Util::cacheSet('is_create_db_priv', $GLOBALS['is_create_db_priv'], true);
PMA_Util::cacheSet('is_process_priv', $GLOBALS['is_process_priv'], true);
PMA_Util::cacheSet('is_reload_priv', $GLOBALS['is_reload_priv'], true);
PMA_Util::cacheSet('db_to_create', $GLOBALS['db_to_create'], true);
PMA_Util::cacheSet('is_create_db_priv', $GLOBALS['is_create_db_priv'], null);
PMA_Util::cacheSet('is_process_priv', $GLOBALS['is_process_priv'], null);
PMA_Util::cacheSet('is_reload_priv', $GLOBALS['is_reload_priv'], null);
PMA_Util::cacheSet('db_to_create', $GLOBALS['db_to_create'], null);
PMA_Util::cacheSet(
'dbs_where_create_table_allowed',
$GLOBALS['dbs_where_create_table_allowed'],
true
null
);
} // end function

View File

@ -70,7 +70,7 @@ if (version_compare(phpversion(), '5.4', 'lt')) {
/**
* Avoid problems with magic_quotes_runtime
*/
@ini_set('magic_quotes_runtime', false);
@ini_set('magic_quotes_runtime', '0');
}
/**

View File

@ -28,7 +28,7 @@ class ConfigFile
/**
* Stores original PMA config, not modified by user preferences
* @var PMA_Config
* @var array
*/
private $_baseCfg;
@ -269,7 +269,7 @@ class ConfigFile
$this->_flattenArrayResult = array();
array_walk($this->_defaultCfg, array($this, '_flattenArray'), '');
$flat_cfg = $this->_flattenArrayResult;
$this->_flattenArrayResult = null;
$this->_flattenArrayResult = array();
return $flat_cfg;
}
@ -287,7 +287,7 @@ class ConfigFile
$this->_flattenArrayResult = array();
array_walk($cfg, array($this, '_flattenArray'), '');
$flat_cfg = $this->_flattenArrayResult;
$this->_flattenArrayResult = null;
$this->_flattenArrayResult = array();
// save values map for translating a few user preferences paths,
// should be complemented by code reading from generated config
@ -519,7 +519,7 @@ class ConfigFile
$this->_flattenArrayResult = array();
array_walk($_SESSION[$this->_id], array($this, '_flattenArray'), '');
$c = $this->_flattenArrayResult;
$this->_flattenArrayResult = null;
$this->_flattenArrayResult = array();
$persistKeys = array_diff(
array_keys($this->_persistKeys),

View File

@ -182,9 +182,9 @@ class PMA_Validator
$old_track_errors = ini_get('track_errors');
$old_display_errors = ini_get('display_errors');
$old_error_reporting = error_reporting(E_ALL);
ini_set('html_errors', false);
ini_set('track_errors', true);
ini_set('display_errors', true);
ini_set('html_errors', '0');
ini_set('track_errors', '1');
ini_set('display_errors', '1');
set_error_handler(array("PMA_Validator", "nullErrorHandler"));
ob_start();
} else {

View File

@ -322,7 +322,8 @@ function PMA_tryColumnCreationQuery($db, $table, $err_url)
$GLOBALS['dbi']->selectDb($db)
or PMA_Util::mysqlDie(
$GLOBALS['dbi']->getError(),
'USE ' . PMA_Util::backquote($db), '',
'USE ' . PMA_Util::backquote($db),
false,
$err_url
);
$sql_query = 'ALTER TABLE ' .

View File

@ -39,7 +39,7 @@ class PMA_DBI_Mysql implements PMA_DBI_Extension
/**
* Helper function for connecting to the database server
*
* @param array $server host/port/socket
* @param string $server host/port/socket
* @param string $user mysql user name
* @param string $password mysql user password
* @param int $client_flags client flags of connection
@ -567,4 +567,4 @@ class PMA_DBI_Mysql implements PMA_DBI_Extension
return false;
}
}
?>
?>

View File

@ -22,7 +22,7 @@ require_once './libraries/display_export.lib.php';
/* Scan for plugins */
$export_list = PMA_getPlugins(
"export",
'export',
'libraries/plugins/export/',
array(
'export_type' => $export_type,

View File

@ -254,7 +254,7 @@ function PMA_getHtmlForExportOptionsSelection($export_type, $multi_values)
/**
* Prints Html For Export Options Format
*
* @param String $export_list Export List
* @param array $export_list Export List
*
* @return string
*/
@ -679,13 +679,13 @@ function PMA_getHtmlForExportOptionsOutput($export_type)
/**
* Prints Html For Export Options
*
* @param String $export_type Selected Export Type
* @param String $db Selected DB
* @param String $table Selected Table
* @param String $multi_values Export selection
* @param String $num_tables number of tables
* @param String $export_list Export List
* @param String $unlim_num_rows Number of Rows
* @param string $export_type Selected Export Type
* @param string $db Selected DB
* @param string $table Selected Table
* @param string $multi_values Export selection
* @param string $num_tables number of tables
* @param array $export_list Export List
* @param string $unlim_num_rows Number of Rows
*
* @return string
*/

View File

@ -43,25 +43,26 @@ function PMA_getReportData($pretty_print = true)
return '';
}
$exception = $_REQUEST['exception'];
$exception["stack"] = PMA_translateStacktrace($exception["stack"]);
List($uri, $script_name) = PMA_sanitizeUrl($exception["url"]);
$exception["uri"] = $uri;
unset($exception["url"]);
$exception['stack'] = PMA_translateStacktrace($exception['stack']);
list($uri, $script_name) = PMA_sanitizeUrl($exception['url']);
$exception['uri'] = $uri;
unset($exception['url']);
$report = array(
"exception" => $exception,
"script_name" => $script_name,
"pma_version" => PMA_VERSION,
"browser_name" => PMA_USR_BROWSER_AGENT,
"browser_version" => PMA_USR_BROWSER_VER,
"user_os" => PMA_USR_OS,
"server_software" => $_SERVER['SERVER_SOFTWARE'],
"user_agent_string" => $_SERVER['HTTP_USER_AGENT'],
"locale" => $_COOKIE['pma_lang'],
"configuration_storage" =>
empty($GLOBALS['cfg']['Servers'][1]['pmadb']) ? "disabled" :
"enabled",
"php_version" => phpversion(),
"microhistory" => $_REQUEST['microhistory'],
'exception' => $exception,
'script_name' => $script_name,
'pma_version' => PMA_VERSION,
'browser_name' => PMA_USR_BROWSER_AGENT,
'browser_version' => PMA_USR_BROWSER_VER,
'user_os' => PMA_USR_OS,
'server_software' => $_SERVER['SERVER_SOFTWARE'],
'user_agent_string' => $_SERVER['HTTP_USER_AGENT'],
'locale' => $_COOKIE['pma_lang'],
'configuration_storage' =>
empty($GLOBALS['cfg']['Servers'][1]['pmadb'])
? 'disabled'
: 'enabled',
'php_version' => phpversion(),
'microhistory' => $_REQUEST['microhistory'],
);
if (! empty($_REQUEST['description'])) {
@ -95,27 +96,27 @@ function PMA_getReportData($pretty_print = true)
function PMA_sanitizeUrl($url)
{
$components = parse_url($url);
if (isset($components["fragment"])
&& preg_match("<PMAURL-\d+:>", $components["fragment"], $matches)
if (isset($components['fragment'])
&& preg_match('<PMAURL-\d+:>', $components['fragment'], $matches)
) {
$uri = str_replace($matches[0], "", $components["fragment"]);
$url = "http://dummy_host/" . $uri;
$uri = str_replace($matches[0], '', $components['fragment']);
$url = 'http://dummy_host/' . $uri;
$components = parse_url($url);
}
// get script name
preg_match("<([a-zA-Z\-_\d]*\.php)$>", $components["path"], $matches);
preg_match('<([a-zA-Z\-_\d]*\.php)$>', $components['path'], $matches);
$script_name = $matches[1];
// remove deployment specific details to make uri more generic
parse_str($components["query"], $query_array);
unset($query_array["db"]);
unset($query_array["table"]);
unset($query_array["token"]);
unset($query_array["server"]);
parse_str($components['query'], $query_array);
unset($query_array['db']);
unset($query_array['table']);
unset($query_array['token']);
unset($query_array['server']);
$query = http_build_query($query_array);
$uri = $script_name . "?" . $query;
$uri = $script_name . '?' . $query;
return array($uri, $script_name);
}
@ -130,8 +131,8 @@ function PMA_sendErrorReport($report)
{
$data_string = json_encode($report);
if (ini_get('allow_url_fopen')) {
$context = array("http" =>
array(
$context = array(
'http' => array(
'method' => 'POST',
'content' => $data_string,
'header' => "Content-Type: multipart/form-data\r\n",
@ -152,7 +153,7 @@ function PMA_sendErrorReport($report)
$curl_handle = curl_init(SUBMISSION_URL);
$curl_handle = PMA_Util::configureCurl($curl_handle);
curl_setopt($curl_handle, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($curl_handle, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($curl_handle, CURLOPT_HTTPHEADER, array('Expect:'));
curl_setopt($curl_handle, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);

View File

@ -454,10 +454,10 @@ function PMA_getHtmlForDisplayedExportHeader($export_type, $db, $table)
* @param string $crlf end of line character(s)
* @param string $err_url the URL in case of error
* @param string $export_type the export type
* @param string $do_relation whether to export relation info
* @param string $do_comments whether to add comments
* @param string $do_mime whether to add MIME info
* @param string $do_dates whether to add dates
* @param bool $do_relation whether to export relation info
* @param bool $do_comments whether to add comments
* @param bool $do_mime whether to add MIME info
* @param bool $do_dates whether to add dates
*
* @return void
*/
@ -494,10 +494,10 @@ function PMA_exportServer(
* @param string $crlf end of line character(s)
* @param string $err_url the URL in case of error
* @param string $export_type the export type
* @param string $do_relation whether to export relation info
* @param string $do_comments whether to add comments
* @param string $do_mime whether to add MIME info
* @param string $do_dates whether to add dates
* @param bool $do_relation whether to export relation info
* @param bool $do_comments whether to add comments
* @param bool $do_mime whether to add MIME info
* @param bool $do_dates whether to add dates
*
* @return void
*/
@ -639,10 +639,10 @@ function PMA_exportDatabase(
* @param string $crlf end of line character(s)
* @param string $err_url the URL in case of error
* @param string $export_type the export type
* @param string $do_relation whether to export relation info
* @param string $do_comments whether to add comments
* @param string $do_mime whether to add MIME info
* @param string $do_dates whether to add dates
* @param bool $do_relation whether to export relation info
* @param bool $do_comments whether to add comments
* @param bool $do_mime whether to add MIME info
* @param bool $do_dates whether to add dates
* @param string $allrows whether "dump all rows" was ticked
* @param string $limit_to upper limit
* @param string $limit_from starting limit

View File

@ -189,9 +189,9 @@ abstract class PMA_GIS_Geometry
/**
* Extracts points, scales and returns them as an array.
*
* @param string $point_set string of comma sperated points
* @param array $scale_data data related to scaling
* @param boolean $linear if true, as a 1D array, else as a 2D array
* @param string $point_set string of comma sperated points
* @param null|array $scale_data data related to scaling
* @param boolean $linear if true, as a 1D array, else as a 2D array
*
* @return array scaled points
* @access protected
@ -210,7 +210,7 @@ abstract class PMA_GIS_Geometry
if (isset($cordinates[0]) && trim($cordinates[0]) != ''
&& isset($cordinates[1]) && trim($cordinates[1]) != ''
) {
if ($scale_data != null) {
if ($scale_data !== null) {
$x = ($cordinates[0] - $scale_data['x']) * $scale_data['scale'];
$y = $scale_data['height']
- ($cordinates[1] - $scale_data['y']) * $scale_data['scale'];

View File

@ -100,11 +100,11 @@ class PMA_GIS_Geometrycollection extends PMA_GIS_Geometry
/**
* Adds to the PNG image object, the data related to a row in the GIS dataset.
*
* @param string $spatial GIS GEOMETRYCOLLECTION object
* @param string $label label for the GIS GEOMETRYCOLLECTION object
* @param string $color color for the GIS GEOMETRYCOLLECTION object
* @param array $scale_data array containing data related to scaling
* @param object $image image object
* @param string $spatial GIS GEOMETRYCOLLECTION object
* @param string $label label for the GIS GEOMETRYCOLLECTION object
* @param string $color color for the GIS GEOMETRYCOLLECTION object
* @param array $scale_data array containing data related to scaling
* @param resource $image image object
*
* @return resource the modified image object
* @access public

View File

@ -63,11 +63,11 @@ class PMA_GIS_Linestring extends PMA_GIS_Geometry
/**
* Adds to the PNG image object, the data related to a row in the GIS dataset.
*
* @param string $spatial GIS LINESTRING object
* @param string $label Label for the GIS LINESTRING object
* @param string $line_color Color for the GIS LINESTRING object
* @param array $scale_data Array containing data related to scaling
* @param object $image Image object
* @param string $spatial GIS LINESTRING object
* @param string $label Label for the GIS LINESTRING object
* @param string $line_color Color for the GIS LINESTRING object
* @param array $scale_data Array containing data related to scaling
* @param resource $image Image object
*
* @return resource the modified image object
* @access public

View File

@ -72,11 +72,11 @@ class PMA_GIS_Multilinestring extends PMA_GIS_Geometry
/**
* Adds to the PNG image object, the data related to a row in the GIS dataset.
*
* @param string $spatial GIS MULTILINESTRING object
* @param string $label Label for the GIS MULTILINESTRING object
* @param string $line_color Color for the GIS MULTILINESTRING object
* @param array $scale_data Array containing data related to scaling
* @param object $image Image object
* @param string $spatial GIS MULTILINESTRING object
* @param string $label Label for the GIS MULTILINESTRING object
* @param string $line_color Color for the GIS MULTILINESTRING object
* @param array $scale_data Array containing data related to scaling
* @param resource $image Image object
*
* @return object the modified image object
* @access public

View File

@ -63,11 +63,11 @@ class PMA_GIS_Multipoint extends PMA_GIS_Geometry
/**
* Adds to the PNG image object, the data related to a row in the GIS dataset.
*
* @param string $spatial GIS MULTIPOINT object
* @param string $label Label for the GIS MULTIPOINT object
* @param string $point_color Color for the GIS MULTIPOINT object
* @param array $scale_data Array containing data related to scaling
* @param object $image Image object
* @param string $spatial GIS MULTIPOINT object
* @param string $label Label for the GIS MULTIPOINT object
* @param string $point_color Color for the GIS MULTIPOINT object
* @param array $scale_data Array containing data related to scaling
* @param resource $image Image object
*
* @return object the modified image object
* @access public

View File

@ -80,11 +80,11 @@ class PMA_GIS_Multipolygon extends PMA_GIS_Geometry
/**
* Adds to the PNG image object, the data related to a row in the GIS dataset.
*
* @param string $spatial GIS MULTIPOLYGON object
* @param string $label Label for the GIS MULTIPOLYGON object
* @param string $fill_color Color for the GIS MULTIPOLYGON object
* @param array $scale_data Array containing data related to scaling
* @param object $image Image object
* @param string $spatial GIS MULTIPOLYGON object
* @param string $label Label for the GIS MULTIPOLYGON object
* @param string $fill_color Color for the GIS MULTIPOLYGON object
* @param array $scale_data Array containing data related to scaling
* @param resource $image Image object
*
* @return object the modified image object
* @access public

View File

@ -63,11 +63,11 @@ class PMA_GIS_Point extends PMA_GIS_Geometry
/**
* Adds to the PNG image object, the data related to a row in the GIS dataset.
*
* @param string $spatial GIS POINT object
* @param string $label Label for the GIS POINT object
* @param string $point_color Color for the GIS POINT object
* @param array $scale_data Array containing data related to scaling
* @param object $image Image object
* @param string $spatial GIS POINT object
* @param string $label Label for the GIS POINT object
* @param string $point_color Color for the GIS POINT object
* @param array $scale_data Array containing data related to scaling
* @param resource $image Image object
*
* @return object the modified image object
* @access public

View File

@ -72,11 +72,11 @@ class PMA_GIS_Polygon extends PMA_GIS_Geometry
/**
* Adds to the PNG image object, the data related to a row in the GIS dataset.
*
* @param string $spatial GIS POLYGON object
* @param string $label Label for the GIS POLYGON object
* @param string $fill_color Color for the GIS POLYGON object
* @param array $scale_data Array containing data related to scaling
* @param object $image Image object
* @param string $spatial GIS POLYGON object
* @param string $label Label for the GIS POLYGON object
* @param string $fill_color Color for the GIS POLYGON object
* @param array $scale_data Array containing data related to scaling
* @param resource $image Image object
*
* @return object the modified image object
* @access public

View File

@ -173,7 +173,7 @@ class PMA_GIS_Visualization
$output .= '<g id="groupPanel">';
$scale_data = $this->_scaleDataSet($this->_data);
$output .= $this->_prepareDataSet($this->_data, $scale_data, 'svg', '');
$output .= $this->_prepareDataSet($this->_data, $scale_data, 'svg');
$output .= '</g>';
$output .= '</svg>';
@ -305,7 +305,7 @@ class PMA_GIS_Visualization
. 'map.addLayers([layerMapnik,layerCycleMap,layerNone]);'
. 'var vectorLayer = new OpenLayers.Layer.Vector("Data");'
. 'var bound;';
$output .= $this->_prepareDataSet($this->_data, $scale_data, 'ol', '');
$output .= $this->_prepareDataSet($this->_data, $scale_data, 'ol');
$output .=
'map.addLayer(vectorLayer);'
. 'map.zoomToExtent(bound);'
@ -441,16 +441,16 @@ class PMA_GIS_Visualization
/**
* Prepares and return the dataset as needed by the visualization.
*
* @param array $data Raw data
* @param array $scale_data Data related to scaling
* @param string $format Format of the visulaization
* @param object $results Image object in the case of png
* TCPDF object in the case of pdf
* @param array $data Raw data
* @param array $scale_data Data related to scaling
* @param string $format Format of the visulaization
* @param null|object $results Image object in the case of png
* TCPDF object in the case of pdf
*
* @return mixed the formatted array of data
* @access private
*/
private function _prepareDataSet($data, $scale_data, $format, $results)
private function _prepareDataSet($data, $scale_data, $format, $results = null)
{
$color_number = 0;

View File

@ -13,7 +13,7 @@ if (! defined('PHPMYADMIN')) {
*
*/
if (! PMA_Util::cacheExists('mysql_charsets', true)) {
if (! PMA_Util::cacheExists('mysql_charsets', null)) {
global $mysql_charsets, $mysql_charsets_descriptions,
$mysql_charsets_available, $mysql_collations, $mysql_collations_available,
$mysql_default_collations, $mysql_collations_flat;
@ -88,47 +88,47 @@ if (! PMA_Util::cacheExists('mysql_charsets', true)) {
unset($key, $value);
PMA_Util::cacheSet(
'mysql_charsets', $GLOBALS['mysql_charsets'], true
'mysql_charsets', $GLOBALS['mysql_charsets'], null
);
PMA_Util::cacheSet(
'mysql_charsets_descriptions', $GLOBALS['mysql_charsets_descriptions'], true
'mysql_charsets_descriptions', $GLOBALS['mysql_charsets_descriptions'], null
);
PMA_Util::cacheSet(
'mysql_charsets_available', $GLOBALS['mysql_charsets_available'], true
'mysql_charsets_available', $GLOBALS['mysql_charsets_available'], null
);
PMA_Util::cacheSet(
'mysql_collations', $GLOBALS['mysql_collations'], true
'mysql_collations', $GLOBALS['mysql_collations'], null
);
PMA_Util::cacheSet(
'mysql_default_collations', $GLOBALS['mysql_default_collations'], true
'mysql_default_collations', $GLOBALS['mysql_default_collations'], null
);
PMA_Util::cacheSet(
'mysql_collations_flat', $GLOBALS['mysql_collations_flat'], true
'mysql_collations_flat', $GLOBALS['mysql_collations_flat'], null
);
PMA_Util::cacheSet(
'mysql_collations_available', $GLOBALS['mysql_collations_available'], true
'mysql_collations_available', $GLOBALS['mysql_collations_available'], null
);
} else {
$GLOBALS['mysql_charsets'] = PMA_Util::cacheGet(
'mysql_charsets', true
'mysql_charsets', null
);
$GLOBALS['mysql_charsets_descriptions'] = PMA_Util::cacheGet(
'mysql_charsets_descriptions', true
'mysql_charsets_descriptions', null
);
$GLOBALS['mysql_charsets_available'] = PMA_Util::cacheGet(
'mysql_charsets_available', true
'mysql_charsets_available', null
);
$GLOBALS['mysql_collations'] = PMA_Util::cacheGet(
'mysql_collations', true
'mysql_collations', null
);
$GLOBALS['mysql_default_collations'] = PMA_Util::cacheGet(
'mysql_default_collations', true
'mysql_default_collations', null
);
$GLOBALS['mysql_collations_flat'] = PMA_Util::cacheGet(
'mysql_collations_flat', true
'mysql_collations_flat', null
);
$GLOBALS['mysql_collations_available'] = PMA_Util::cacheGet(
'mysql_collations_available', true
'mysql_collations_available', null
);
}

View File

@ -13,8 +13,8 @@ if (! defined('PHPMYADMIN')) {
* Generate charset dropdown box
*
* @param int $type Type
* @param null $name Element name
* @param null $id Element id
* @param null|string $name Element name
* @param null|string $id Element id
* @param null|string $default Default value
* @param bool $label Label
* @param int $indent Indent

View File

@ -15,7 +15,7 @@
* @param mixed $plugin_param parameter to plugin by which they can
* decide whether they can work
*
* @return object|null new plugin instance
* @return object new plugin instance
*/
function PMA_getPlugin(
$plugin_type,
@ -34,7 +34,8 @@ function PMA_getPlugin(
return new $class_name;
}
return null;
// by default, return SQL plugin
return PMA_getPlugin($plugin_type, 'sql', $plugins_dir, $plugin_param);
}
/**

View File

@ -466,11 +466,11 @@ class AuthenticationCookie extends AuthenticationPlugin
$last_access_time = time() - $GLOBALS['cfg']['LoginCookieValidity'];
if ($_SESSION['last_access_time'] < $last_access_time
) {
PMA_Util::cacheUnset('is_create_db_priv', true);
PMA_Util::cacheUnset('is_process_priv', true);
PMA_Util::cacheUnset('is_reload_priv', true);
PMA_Util::cacheUnset('db_to_create', true);
PMA_Util::cacheUnset('dbs_where_create_table_allowed', true);
PMA_Util::cacheUnset('is_create_db_priv', null);
PMA_Util::cacheUnset('is_process_priv', null);
PMA_Util::cacheUnset('is_reload_priv', null);
PMA_Util::cacheUnset('db_to_create', null);
PMA_Util::cacheUnset('dbs_where_create_table_allowed', null);
$GLOBALS['no_activity'] = true;
$this->authFails();
if (! defined('TESTSUITE')) {

View File

@ -29,6 +29,7 @@ class PMA_Export_Relation_Schema
public $orientation;
public $paper;
public $pageNumber;
public $exportType;
/**
* Set Page Number

View File

@ -25,7 +25,7 @@ if (!@function_exists('session_name')) {
// disable starting of sessions before all settings are done
// does not work, besides how it is written in php manual
//ini_set('session.auto_start', 0);
//ini_set('session.auto_start', '0');
// session cookie settings
session_set_cookie_params(
@ -34,7 +34,7 @@ session_set_cookie_params(
);
// cookies are safer (use @ini_set() in case this function is disabled)
@ini_set('session.use_cookies', true);
@ini_set('session.use_cookies', '1');
// optionally set session_save_path
$path = $GLOBALS['PMA_Config']->get('SessionSavePath');
@ -43,9 +43,9 @@ if (!empty($path)) {
}
// but not all user allow cookies
@ini_set('session.use_only_cookies', false);
@ini_set('session.use_only_cookies', '0');
// do not force transparent session ids, see bug #3398788
//@ini_set('session.use_trans_sid', true);
//@ini_set('session.use_trans_sid', '1');
@ini_set(
'url_rewriter.tags',
'a=href,frame=src,input=src,form=fakeentry,fieldset='
@ -53,14 +53,14 @@ if (!empty($path)) {
//ini_set('arg_separator.output', '&amp;');
// delete session/cookies when browser is closed
@ini_set('session.cookie_lifetime', 0);
@ini_set('session.cookie_lifetime', '0');
// warn but dont work with bug
@ini_set('session.bug_compat_42', false);
@ini_set('session.bug_compat_warn', true);
// warn but don't work with bug
@ini_set('session.bug_compat_42', '0');
@ini_set('session.bug_compat_warn', '1');
// use more secure session ids
@ini_set('session.hash_function', 1);
@ini_set('session.hash_function', '1');
// some pages (e.g. stylesheet) may be cached on clients, but not in shared
// proxy servers

View File

@ -308,7 +308,7 @@ function PMA_getColumnNameInColumnDropSql($sql)
*
* @param array $fields_meta meta fields
*
* @return boolean whether the result set has columns from just one table
* @return boolean whether the result set has columns from just one table
*/
function PMA_resultSetHasJustOneTable($fields_meta)
{
@ -322,7 +322,7 @@ function PMA_resultSetHasJustOneTable($fields_meta)
break;
}
}
return $just_one_table;
return $just_one_table;
}
/**
@ -2075,7 +2075,7 @@ function PMA_sendQueryResponseForResultsReturned($result, $justBrowsing,
$has_unique = PMA_resultSetContainsUniqueKey(
$db, $table, $fields_meta
);
$just_one_table = PMA_resultSetHasJustOneTable($fields_meta);
$editable = ($has_unique || $updatableView) && $just_one_table;
@ -2256,29 +2256,29 @@ function PMA_sendQueryResponse($num_rows, $unlim_num_rows, $is_affected,
/**
* Function to execute the query and send the response
*
* @param array $analyzed_sql_results analysed sql results
* @param bool $is_gotofile whether goto file or not
* @param string $db current database
* @param string $table current table
* @param bool $find_real_end whether to find real end or not
* @param string $sql_query_for_bookmark the sql query to be stored as bookmark
* @param array $extra_data extra data
* @param bool $is_affected whether affected or not
* @param string $message_to_show message to show
* @param string $disp_mode display mode
* @param string $message message
* @param array $sql_data sql data
* @param string $goto goto page url
* @param string $pmaThemeImage uri of the PMA theme image
* @param string $disp_query display query
* @param string $disp_message display message
* @param string $query_type query type
* @param string $sql_query sql query
* @param bool $selected whether check table, optimize table,
* analyze table or repair table has been
* selected with respect to the selected
* tables from the database structure page
* @param string $complete_query complete query
* @param array $analyzed_sql_results analysed sql results
* @param bool $is_gotofile whether goto file or not
* @param string $db current database
* @param string $table current table
* @param bool|null $find_real_end whether to find real end or not
* @param string $sql_query_for_bookmark the sql query to be stored as bookmark
* @param array|null $extra_data extra data
* @param bool $is_affected whether affected or not
* @param string $message_to_show message to show
* @param string $disp_mode display mode
* @param string $message message
* @param array|null $sql_data sql data
* @param string $goto goto page url
* @param string $pmaThemeImage uri of the PMA theme image
* @param string $disp_query display query
* @param string $disp_message display message
* @param string $query_type query type
* @param string $sql_query sql query
* @param bool|null $selected whether check table, optimize table,
* analyze table or repair table has been
* selected with respect to the selected
* tables from the database structure page
* @param string $complete_query complete query
*
* @return void
*/

View File

@ -264,7 +264,7 @@ function PMA_getHtmlBodyForTableSummary($num_tables, $server_slave_status,
* @param string $text_dir url for text directory
* @param string $overhead_check overhead check
* @param boolean $db_is_system_schema whether database is information schema or not
* @param string $hidden_fields hidden fields
* @param array $hidden_fields hidden fields
*
* @return string $html_output
*/
@ -479,7 +479,7 @@ function PMA_getHtmlForStructureTableRow(
}
//Favorite table anchor.
$html_output .= '<td class="center">'
. PMA_getHtmlForFavoriteAnchor($db, $current_table, $titles)
. PMA_getHtmlForFavoriteAnchor($db, $current_table['TABLE_NAME'], $titles)
. '</td>';
$html_output .= '<td class="center">' . $browse_table . '</td>';
@ -2729,23 +2729,23 @@ function PMA_checkFavoriteTable($db, $current_table)
*
* @param string $db current database
* @param string $current_table current table
* @param string $titles titles
* @param array $titles titles
*
* @return $html_output
*/
function PMA_getHtmlForFavoriteAnchor($db, $current_table, $titles)
{
$html_output = '<a ';
$html_output .= 'id="' . md5($current_table['TABLE_NAME'])
$html_output .= 'id="' . md5($current_table)
. '_favorite_anchor" ';
$html_output .= 'class="ajax favorite_table_anchor';
// Check if current table is already in favorite list.
$already_favorite = PMA_checkFavoriteTable($db, $current_table['TABLE_NAME']);
$already_favorite = PMA_checkFavoriteTable($db, $current_table);
$fav_params = array('db' => $db,
'ajax_request' => true,
'favorite_table' => $current_table['TABLE_NAME'],
(($already_favorite?'remove':'add') . '_favorite') => true
'favorite_table' => $current_table,
(($already_favorite ? 'remove' : 'add') . '_favorite') => true
);
$fav_url = 'db_structure.php' . PMA_URL_getCommon($fav_params);
$html_output .= '" ';
@ -2753,7 +2753,7 @@ function PMA_getHtmlForFavoriteAnchor($db, $current_table, $titles)
. '" title="' . ($already_favorite ? __("Remove from Favorites")
: __("Add to Favorites"))
. '" data-favtargets="'
. md5($db . "." . $current_table['TABLE_NAME'])
. md5($db . "." . $current_table)
. '" >'
. (!$already_favorite ? $titles['NoFavorite']
: $titles['Favorite']) . '</a>';

View File

@ -12,7 +12,7 @@ if (! defined('PHPMYADMIN')) {
/**
* Generates text with hidden inputs.
*
* @param string $db optional database name
* @param string|array $db optional database name
* (can also be an array of parameters)
* @param string $table optional table name
* @param int $indent indenting level

View File

@ -50,12 +50,12 @@ class PMA_Cache_Test extends PHPUnit_Framework_TestCase
public function testCacheExists()
{
$GLOBALS['server'] = 'server';
PMA_Util::cacheSet('test_data', 5, true);
PMA_Util::cacheSet('test_data_2', 5, true);
PMA_Util::cacheSet('test_data', 5, null);
PMA_Util::cacheSet('test_data_2', 5, null);
$this->assertTrue(PMA_Util::cacheExists('test_data', true));
$this->assertTrue(PMA_Util::cacheExists('test_data', null));
$this->assertTrue(PMA_Util::cacheExists('test_data_2', 'server'));
$this->assertFalse(PMA_Util::cacheExists('fake_data_2', true));
$this->assertFalse(PMA_Util::cacheExists('fake_data_2', null));
}
/**
@ -66,12 +66,12 @@ class PMA_Cache_Test extends PHPUnit_Framework_TestCase
public function testCacheGet()
{
$GLOBALS['server'] = 'server';
PMA_Util::cacheSet('test_data', 5, true);
PMA_Util::cacheSet('test_data_2', 5, true);
PMA_Util::cacheSet('test_data', 5, null);
PMA_Util::cacheSet('test_data_2', 5, null);
$this->assertNotNull(PMA_Util::cacheGet('test_data', true));
$this->assertNotNull(PMA_Util::cacheGet('test_data', null));
$this->assertNotNull(PMA_Util::cacheGet('test_data_2', 'server'));
$this->assertNull(PMA_Util::cacheGet('fake_data_2', true));
$this->assertNull(PMA_Util::cacheGet('fake_data_2', null));
}
/**
@ -82,11 +82,11 @@ class PMA_Cache_Test extends PHPUnit_Framework_TestCase
public function testCacheSetGet()
{
$GLOBALS['server'] = 'server';
PMA_Util::cacheSet('test_data', 25, true);
PMA_Util::cacheSet('test_data', 25, null);
PMA_Util::cacheSet('test_data', 5, true);
PMA_Util::cacheSet('test_data', 5, null);
$this->assertEquals(5, $_SESSION['cache']['server_server']['test_data']);
PMA_Util::cacheSet('test_data_3', 3, true);
PMA_Util::cacheSet('test_data_3', 3, null);
$this->assertEquals(3, $_SESSION['cache']['server_server']['test_data_3']);
}
@ -98,12 +98,12 @@ class PMA_Cache_Test extends PHPUnit_Framework_TestCase
public function testCacheUnSet()
{
$GLOBALS['server'] = 'server';
PMA_Util::cacheSet('test_data', 25, true);
PMA_Util::cacheSet('test_data_2', 25, true);
PMA_Util::cacheSet('test_data', 25, null);
PMA_Util::cacheSet('test_data_2', 25, null);
PMA_Util::cacheUnset('test_data', true);
PMA_Util::cacheUnset('test_data', null);
$this->assertArrayNotHasKey('test_data', $_SESSION['cache']['server_server']);
PMA_Util::cacheUnset('test_data_2', true);
PMA_Util::cacheUnset('test_data_2', null);
$this->assertArrayNotHasKey('test_data_2', $_SESSION['cache']['server_server']);
}
@ -115,7 +115,7 @@ class PMA_Cache_Test extends PHPUnit_Framework_TestCase
public function testClearUserCache()
{
$GLOBALS['server'] = 'server';
PMA_Util::cacheSet('is_superuser', 'yes', true);
PMA_Util::cacheSet('is_superuser', 'yes', null);
$this->assertEquals('yes', $_SESSION['cache']['server_server']['is_superuser']);
PMA_Util::clearUserCache();