Spaces between parameters in function calls

This commit is contained in:
Madhura Jayaratne 2011-09-23 08:43:41 +05:30
parent ac088aaee0
commit e67a0a2531
45 changed files with 171 additions and 171 deletions

View File

@ -234,7 +234,7 @@ if (strlen($db) && (! empty($db_rename) || ! empty($db_copy))) {
// to avoid selecting alternatively the current and new db
// we would need to modify the CREATE definitions to qualify
// the db name
$event_names = PMA_DBI_fetch_result('SELECT EVENT_NAME FROM information_schema.EVENTS WHERE EVENT_SCHEMA= \'' . PMA_sqlAddSlashes($db,true) . '\';');
$event_names = PMA_DBI_fetch_result('SELECT EVENT_NAME FROM information_schema.EVENTS WHERE EVENT_SCHEMA= \'' . PMA_sqlAddSlashes($db, true) . '\';');
if ($event_names) {
foreach ($event_names as $event_name) {
PMA_DBI_select_db($db);

View File

@ -342,7 +342,7 @@ if (!$save_on_server) {
// Download
// (avoid rewriting data containing HTML with anchors and forms;
// this was reported to happen under Plesk)
@ini_set('url_rewriter.tags','');
@ini_set('url_rewriter.tags', '');
$filename = PMA_sanitize_filename($filename);
PMA_download_header($filename, $mime_type);

View File

@ -453,10 +453,10 @@ require_once './libraries/List.class.php';
// TODO: db names may contain characters
// that are regexp instructions
$re = '(^|(\\\\\\\\)+|[^\])';
$tmp_regex = preg_replace('/' . addcslashes($re,'/') . '%/', '\\1.*', preg_replace('/' . addcslashes($re,'/') . '_/', '\\1.{1}', $tmp_matchpattern));
$tmp_regex = preg_replace('/' . addcslashes($re, '/') . '%/', '\\1.*', preg_replace('/' . addcslashes($re,'/') . '_/', '\\1.{1}', $tmp_matchpattern));
// Fixed db name matching
// 2000-08-28 -- Benjamin Gandon
if (preg_match('/^' . addcslashes($tmp_regex,'/') . '$/', $tmp_db)) {
if (preg_match('/^' . addcslashes($tmp_regex, '/') . '$/', $tmp_db)) {
$dblist[] = $tmp_db;
break;
}

View File

@ -18,18 +18,18 @@
/**
* Errors codes
*/
define ("SWEKEY_ERR_INVALID_DEV_STATUS",901); // The satus of the device is not SWEKEY_STATUS_OK
define ("SWEKEY_ERR_INTERNAL",902); // Should never occurd
define ("SWEKEY_ERR_OUTDATED_RND_TOKEN",910); // You random token is too old
define ("SWEKEY_ERR_INVALID_OTP",911); // The otp was not correct
define ("SWEKEY_ERR_INVALID_DEV_STATUS", 901); // The satus of the device is not SWEKEY_STATUS_OK
define ("SWEKEY_ERR_INTERNAL", 902); // Should never occurd
define ("SWEKEY_ERR_OUTDATED_RND_TOKEN", 910); // You random token is too old
define ("SWEKEY_ERR_INVALID_OTP", 911); // The otp was not correct
/**
* Those errors are considered as an attack and your site will be blacklisted during one minute
* if you receive one of those errors
*/
define ("SWEKEY_ERR_BADLY_ENCODED_REQUEST",920);
define ("SWEKEY_ERR_INVALID_RND_TOKEN",921);
define ("SWEKEY_ERR_DEV_NOT_FOUND",922);
define ("SWEKEY_ERR_BADLY_ENCODED_REQUEST", 920);
define ("SWEKEY_ERR_INVALID_RND_TOKEN", 921);
define ("SWEKEY_ERR_DEV_NOT_FOUND", 922);
/**
* Default values for configuration.
@ -252,7 +252,7 @@ function Swekey_HttpGet($url, &$response_code)
$r = new HttpRequest($url);
$options = array('timeout' => '3');
if (substr($url,0, 6) == "https:")
if (substr($url, 0, 6) == "https:")
{
$sslOptions = array();
$sslOptions['verifypeer'] = true;
@ -392,7 +392,7 @@ function Swekey_GetFastHalfRndToken()
{
// we unlink the file so no possible tempfile race attack
unlink($cachefile);
$file = fopen($cachefile , "x");
$file = fopen($cachefile, "x");
if ($file != false)
{
@fwrite($file, $res);
@ -442,22 +442,22 @@ function Swekey_CheckOtp($id, $rt, $otp)
* Values that are associated with a key.
* The following values can be returned by the Swekey_GetStatus() function
*/
define ("SWEKEY_STATUS_OK",0);
define ("SWEKEY_STATUS_NOT_FOUND",1); // The key does not exist in the db
define ("SWEKEY_STATUS_INACTIVE",2); // The key has never been activated
define ("SWEKEY_STATUS_LOST",3); // The user has lost his key
define ("SWEKEY_STATUS_STOLEN",4); // The key was stolen
define ("SWEKEY_STATUS_FEE_DUE",5); // The annual fee was not paid
define ("SWEKEY_STATUS_OBSOLETE",6); // The hardware is no longer supported
define ("SWEKEY_STATUS_UNKOWN",201); // We could not connect to the authentication server
define ("SWEKEY_STATUS_OK", 0);
define ("SWEKEY_STATUS_NOT_FOUND", 1); // The key does not exist in the db
define ("SWEKEY_STATUS_INACTIVE", 2); // The key has never been activated
define ("SWEKEY_STATUS_LOST", 3); // The user has lost his key
define ("SWEKEY_STATUS_STOLEN", 4); // The key was stolen
define ("SWEKEY_STATUS_FEE_DUE", 5); // The annual fee was not paid
define ("SWEKEY_STATUS_OBSOLETE", 6); // The hardware is no longer supported
define ("SWEKEY_STATUS_UNKOWN", 201); // We could not connect to the authentication server
/**
* Values that are associated with a key.
* The Javascript Api can also return the following values
*/
define ("SWEKEY_STATUS_REPLACED",100); // This key has been replaced by a backup key
define ("SWEKEY_STATUS_BACKUP_KEY",101); // This key is a backup key that is not activated yet
define ("SWEKEY_STATUS_NOTPLUGGED",200); // This key is not plugged in the computer
define ("SWEKEY_STATUS_REPLACED", 100); // This key has been replaced by a backup key
define ("SWEKEY_STATUS_BACKUP_KEY", 101); // This key is a backup key that is not activated yet
define ("SWEKEY_STATUS_NOTPLUGGED", 200); // This key is not plugged in the computer
/**

View File

@ -61,7 +61,7 @@ if (typeof(parent.document) != 'undefined' && typeof(parent.document) != 'unknow
}
<?php
if(count($GLOBALS['js_script']) > 0) {
echo implode("\n",$GLOBALS['js_script'])."\n";
echo implode("\n", $GLOBALS['js_script'])."\n";
}
foreach ($GLOBALS['js_events'] as $js_event) {

View File

@ -407,7 +407,7 @@ function PMA_getColumnNumberFromName($name)
// base26 to base10 conversion : multiply each number
// with corresponding value of the position, in this case
// $i=0 : 1; $i=1 : 26; $i=2 : 676; ...
$column_number += $number * pow(26,$i);
$column_number += $number * pow(26, $i);
}
return $column_number;
} else {

View File

@ -430,14 +430,14 @@ elseif ($mult_btn == __('Yes')) {
case 'replace_prefix_tbl':
$current = $selected[$i];
$newtablename = preg_replace("/^" . $from_prefix . "/" , $to_prefix , $current);
$newtablename = preg_replace("/^" . $from_prefix . "/", $to_prefix, $current);
$a_query = 'ALTER TABLE ' . PMA_backquote($selected[$i]) . ' RENAME ' . PMA_backquote($newtablename) ; // CHANGE PREFIX PATTERN
$run_parts = true;
break;
case 'copy_tbl_change_prefix':
$current = $selected[$i];
$newtablename = preg_replace("/^" . $from_prefix . "/" , $to_prefix , $current);
$newtablename = preg_replace("/^" . $from_prefix . "/", $to_prefix, $current);
$a_query = 'CREATE TABLE ' . PMA_backquote($newtablename) . ' SELECT * FROM ' . PMA_backquote($selected[$i]) ; // COPY TABLE AND CHANGE PREFIX PATTERN
$run_parts = true;
break;

View File

@ -369,7 +369,7 @@ function PMA_replication_synchronize_db($db, $src_link, $trg_link, $data = true)
$target_columns, $alter_str_array, $add_column_array, $uncommon_columns, $criteria, $target_tables_keys, $counter);
PMA_indexesDiffInTables($src_db, $trg_db, $src_link, $trg_link, $matching_tables, $source_indexes, $target_indexes,
$add_indexes_array, $alter_indexes_array,$remove_indexes_array, $counter);
$add_indexes_array, $alter_indexes_array, $remove_indexes_array, $counter);
}
/**

View File

@ -149,8 +149,8 @@ function PMA_langDetect($str, $envType)
if (strpos($expr, '[-_]') === false) {
$expr = str_replace('|', '([-_][[:alpha:]]{2,3})?|', $expr);
}
if (($envType == 1 && preg_match('/^(' . addcslashes($expr,'/') . ')(;q=[0-9]\\.[0-9])?$/i', $str))
|| ($envType == 2 && preg_match('/(\(|\[|;[[:space:]])(' . addcslashes($expr,'/') . ')(;|\]|\))/i', $str))) {
if (($envType == 1 && preg_match('/^(' . addcslashes($expr, '/') . ')(;q=[0-9]\\.[0-9])?$/i', $str))
|| ($envType == 2 && preg_match('/(\(|\[|;[[:space:]])(' . addcslashes($expr, '/') . ')(;|\]|\))/i', $str))) {
if (PMA_langSet($lang)) {
return true;
}

View File

@ -467,7 +467,7 @@ function PMA_updateTargetTables($table, $update_array, $src_db, $trg_db, $trg_li
*/
function PMA_insertIntoTargetTable($matching_table, $src_db, $trg_db, $src_link, $trg_link, $table_fields, &$array_insert, $matching_table_index,
$matching_tables_keys, $source_columns, &$add_column_array, $criteria, $target_tables_keys, $uncommon_tables, &$uncommon_tables_fields, $uncommon_cols,
&$alter_str_array,&$source_indexes, &$target_indexes, &$add_indexes_array, &$alter_indexes_array, &$delete_array, &$update_array, $display)
&$alter_str_array, &$source_indexes, &$target_indexes, &$add_indexes_array, &$alter_indexes_array, &$delete_array, &$update_array, $display)
{
if (isset($array_insert[$matching_table_index])) {
if (sizeof($array_insert[$matching_table_index])) {
@ -519,7 +519,7 @@ function PMA_insertIntoTargetTable($matching_table, $src_db, $trg_db, $src_link,
unset($delete_array[$table_index[0]]);
}
PMA_addColumnsInTargetTable($src_db, $trg_db, $src_link, $trg_link, $matching_tables, $source_columns, $add_column_array,
$matching_tables_fields, $criteria, $matching_tables_keys, $target_tables_keys, $uncommon_tables,$uncommon_tables_fields,
$matching_tables_fields, $criteria, $matching_tables_keys, $target_tables_keys, $uncommon_tables, $uncommon_tables_fields,
$table_index[0], $uncommon_cols, $display);
unset($add_column_array[$table_index[0]]);
}
@ -1125,8 +1125,8 @@ function PMA_indexesDiffInTables($src_db, $trg_db, $src_link, $trg_link, $matchi
&$alter_indexes_array, &$remove_indexes_array, $table_counter)
{
//Gets indexes information for source and target table
$source_indexes[$table_counter] = PMA_DBI_get_table_indexes($src_db, $matching_tables[$table_counter],$src_link);
$target_indexes[$table_counter] = PMA_DBI_get_table_indexes($trg_db, $matching_tables[$table_counter],$trg_link);
$source_indexes[$table_counter] = PMA_DBI_get_table_indexes($src_db, $matching_tables[$table_counter], $src_link);
$target_indexes[$table_counter] = PMA_DBI_get_table_indexes($trg_db, $matching_tables[$table_counter], $trg_link);
for ($a = 0; $a < sizeof($source_indexes[$table_counter]); $a++) {
$found = false;
$z = 0;

View File

@ -119,7 +119,7 @@ class PMA_Scatter_Plot
$this->_dataPoints = array();
if (! is_null($this->_userSpecifiedSettings)) {
foreach (array_keys($this->_userSpecifiedSettings) as $key){
$this->_settings[$key] = $this->_userSpecifiedSettings[$key];
$this->_settings[$key] = $this->_userSpecifiedSettings[$key];
}
}
if ($this->_settings['dataLabel'] == '') {
@ -188,17 +188,17 @@ class PMA_Scatter_Plot
*
* @return an array containing the scale, x and y offsets
*/
private function _scaleDataSet($data,$xField,$yField)
private function _scaleDataSet($data, $xField, $yField)
{
// Currently assuming only numeric fields are selected
// Currently assuming only numeric fields are selected
$coordinates = array();
foreach ($data as $row) {
$coordinates[0][] = $row[$xField];
$coordinates[1][] = $row[$yField];
}
for ($i = 0 ; $i < 2 ; $i++) {
$maxC = ($i == 0) ? 500 : 320;
$maxC = ($i == 0) ? 500 : 320;
if ( !is_numeric($coordinates[$i][0])) {
$uniqueC = array_unique($coordinates[$i]);
@ -244,8 +244,8 @@ class PMA_Scatter_Plot
for ($i = 0 ; $i < count($data) ; $i++) {
$index = $color_number % sizeof($this->_settings['colors']);
$data_element = new PMA_SVG_Data_Point($scale_data[0][$i],$scale_data[1][$i],$data[$i][$label],$data[$i]);
$data_element = new PMA_SVG_Data_Point($scale_data[0][$i], $scale_data[1][$i], $data[$i][$label], $data[$i]);
$options = array('color' => $this->_settings['colors'][$index], 'id' => $i);
$this->_dataPoints[] = $data_element;

View File

@ -13,7 +13,7 @@ class PMA_SVG_Data_Point extends PMA_SVG_Data_Element
* X-Coordinate of the point
*/
private $cx;
/*
* Y-Coordinate of the point
*/
@ -24,7 +24,7 @@ class PMA_SVG_Data_Point extends PMA_SVG_Data_Element
*/
public function __construct($cx, $cy, $label, $dataRow)
{
parent::__construct($label,$dataRow);
parent::__construct($label, $dataRow);
$this->cx = $cx;
$this->cy = $cy;
}
@ -50,7 +50,7 @@ class PMA_SVG_Data_Point extends PMA_SVG_Data_Element
'stroke' => $options['color'],
'stroke-width'=> 2,
);
$row = '<circle cx="' . $this->cx . '" cy="' . $this->cy . '" r=".1"';
foreach ($point_options as $option => $val) {
$row .= ' ' . $option . '="' . trim($val) . '"';
@ -59,7 +59,7 @@ class PMA_SVG_Data_Point extends PMA_SVG_Data_Element
return $row;
}
public function getCx()
{
return $this->cx;

View File

@ -14,7 +14,7 @@
*/
function getSysInfo()
{
$supported = array('Linux','WINNT');
$supported = array('Linux', 'WINNT');
$sysinfo = array();
@ -110,7 +110,7 @@ class Linux
function loadavg() {
$buf = file_get_contents('/proc/stat');
$nums=preg_split("/\s+/", substr($buf,0,strpos($buf,"\n")));
$nums=preg_split("/\s+/", substr($buf, 0, strpos($buf, "\n")));
return Array('busy' => $nums[1]+$nums[2]+$nums[3], 'idle' => intval($nums[4]));
}

View File

@ -315,7 +315,7 @@ if ($GLOBALS['cfg']['LeftFrameLight'] && strlen($GLOBALS['db'])) {
echo '</div>' . "\n";
$common_url_query = PMA_generate_common_url();
PMA_displayDbList($GLOBALS['pma']->databases->getGroupedDetails($_SESSION['tmp_user_values']['navi_limit_offset'],$GLOBALS['cfg']['MaxDbList']), $_SESSION['tmp_user_values']['navi_limit_offset'],$GLOBALS['cfg']['MaxDbList']);
PMA_displayDbList($GLOBALS['pma']->databases->getGroupedDetails($_SESSION['tmp_user_values']['navi_limit_offset'], $GLOBALS['cfg']['MaxDbList']), $_SESSION['tmp_user_values']['navi_limit_offset'], $GLOBALS['cfg']['MaxDbList']);
}
/**

View File

@ -287,17 +287,17 @@ for ($i = 0; $i < count($GLOBALS['PMD']["TABLE_NAME"]); $i++) {
} else {
?>
<img src="<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>pmd/Field_small<?php
if (strstr($tab_column[$t_n]["TYPE"][$j],'char')
|| strstr($tab_column[$t_n]["TYPE"][$j],'text')) {
if (strstr($tab_column[$t_n]["TYPE"][$j], 'char')
|| strstr($tab_column[$t_n]["TYPE"][$j], 'text')) {
echo '_char';
} elseif (strstr($tab_column[$t_n]["TYPE"][$j],'int')
|| strstr($tab_column[$t_n]["TYPE"][$j],'float')
|| strstr($tab_column[$t_n]["TYPE"][$j],'double')
|| strstr($tab_column[$t_n]["TYPE"][$j],'decimal')) {
} elseif (strstr($tab_column[$t_n]["TYPE"][$j], 'int')
|| strstr($tab_column[$t_n]["TYPE"][$j], 'float')
|| strstr($tab_column[$t_n]["TYPE"][$j], 'double')
|| strstr($tab_column[$t_n]["TYPE"][$j], 'decimal')) {
echo '_int';
} elseif (strstr($tab_column[$t_n]["TYPE"][$j],'date')
|| strstr($tab_column[$t_n]["TYPE"][$j],'time')
|| strstr($tab_column[$t_n]["TYPE"][$j],'year')) {
} elseif (strstr($tab_column[$t_n]["TYPE"][$j], 'date')
|| strstr($tab_column[$t_n]["TYPE"][$j], 'time')
|| strstr($tab_column[$t_n]["TYPE"][$j], 'year')) {
echo '_date';
}
?>.png" alt="*" />

View File

@ -39,7 +39,7 @@ if (isset($mode)) {
if ('export' == $mode) {
$sql = "REPLACE INTO " . $pma_table . " (db_name, table_name, pdf_page_number, x, y) SELECT db_name, table_name, " . $pdf_page_number_q . ", ROUND(x/" . $scale_q . ") , ROUND(y/" . $scale_q . ") y FROM " . $pmd_table . " WHERE db_name = '" . PMA_sqlAddSlashes($db) . "'";
PMA_query_as_controluser($sql,true,PMA_DBI_QUERY_STORE);
PMA_query_as_controluser($sql, true, PMA_DBI_QUERY_STORE);
}
if ('import' == $mode) {
@ -101,7 +101,7 @@ if (1 == count($choices)) {
echo $choices['create_export'];
echo '<input type="hidden" name="mode" value="create_export" />';
} else {
PMA_display_html_radio('mode', $choices, $checked_choice = '', $line_break = true, $escape_label = false, $class='');
PMA_display_html_radio('mode', $choices, $checked_choice = '', $line_break = true, $escape_label = false, $class = '');
}
echo '<br />';
echo '<label for="newpage">' . __('New page name: ') . '</label>';

View File

@ -24,7 +24,7 @@ if (PMA_foreignkey_supported($type_T1) && PMA_foreignkey_supported($type_T2) &&
$existrel_foreign = PMA_getForeigners($db, $T2, '', 'foreign');
if (isset($existrel_foreign[$F2])
&& isset($existrel_foreign[$F2]['constraint'])) {
PMD_return_new(0,__('Error: relation already exists.'));
PMD_return_new(0, __('Error: relation already exists.'));
}
// note: in InnoDB, the index does not requires to be on a PRIMARY
// or UNIQUE key
@ -56,8 +56,8 @@ if (PMA_foreignkey_supported($type_T1) && PMA_foreignkey_supported($type_T2) &&
if ($on_update != 'nix') {
$upd_query .= ' ON UPDATE ' . $on_update;
}
PMA_DBI_try_query($upd_query) or PMD_return_new(0,__('Error: Relation not added.'));
PMD_return_new(1,__('FOREIGN KEY relation added'));
PMA_DBI_try_query($upd_query) or PMD_return_new(0, __('Error: Relation not added.'));
PMD_return_new(1, __('FOREIGN KEY relation added'));
}
// internal (pmadb) relation
@ -78,7 +78,7 @@ if (PMA_foreignkey_supported($type_T1) && PMA_foreignkey_supported($type_T2) &&
. '\'' . PMA_sqlAddSlashes($T1) . '\','
. '\'' . PMA_sqlAddSlashes($F1) . '\')';
if (PMA_query_as_controluser($q , false, PMA_DBI_QUERY_STORE)) {
if (PMA_query_as_controluser($q, false, PMA_DBI_QUERY_STORE)) {
PMD_return_new(1, __('Internal relation added'));
} else {
PMD_return_new(0, __('Error: Relation not added.'));

View File

@ -13,8 +13,8 @@ extract($_POST, EXTR_SKIP);
extract($_GET, EXTR_SKIP);
$die_save_pos = 0;
require_once 'pmd_save_pos.php';
list($DB1,$T1) = explode(".",$T1);
list($DB2,$T2) = explode(".",$T2);
list($DB1, $T1) = explode(".", $T1);
list($DB2, $T2) = explode(".", $T2);
$tables = PMA_DBI_get_tables_full($db, $T1);
$type_T1 = strtoupper($tables[$T1]['ENGINE']);
@ -54,7 +54,7 @@ if ($try_to_delete_internal_relation) {
}
PMD_return_upd(1, __('Relation deleted'));
function PMD_return_upd($b,$ret)
function PMD_return_upd($b, $ret)
{
global $K;
header("Content-Type: text/xml; charset=utf-8");

View File

@ -28,7 +28,7 @@ require_once "./libraries/schema/Export_Relation_Schema.class.php";
* call and include the appropriate Schema Class depending on $export_type
* default is PDF
*/
global $db,$export_type;
global $db, $export_type;
if (!isset($export_type) || !preg_match('/^[a-zA-Z]+$/', $export_type)) {
$export_type = 'pdf';
}
@ -36,7 +36,7 @@ PMA_DBI_select_db($db);
$path = PMA_securePath(ucfirst($export_type));
if (!file_exists('./libraries/schema/' . $path . '_Relation_Schema.class.php')) {
PMA_Export_Relation_Schema::dieSchema($_POST['chpage'],$export_type,__('File doesn\'t exist'));
PMA_Export_Relation_Schema::dieSchema($_POST['chpage'], $export_type, __('File doesn\'t exist'));
}
require "./libraries/schema/".$path."_Relation_Schema.class.php";
$obj_schema = eval("new PMA_".$path."_Relation_Schema();");

View File

@ -587,10 +587,10 @@ if (isset($_REQUEST['Table_ids'])) {
unset($delete_array[$matching_table_structure_diff[$q]]);
}
PMA_addColumnsInTargetTable($src_db, $trg_db,$src_link, $trg_link,
PMA_addColumnsInTargetTable($src_db, $trg_db, $src_link, $trg_link,
$matching_tables, $source_columns, $add_column_array,
$matching_tables_fields, $criteria, $matching_tables_keys,
$target_tables_keys, $uncommon_tables,$uncommon_tables_fields,
$target_tables_keys, $uncommon_tables, $uncommon_tables_fields,
$matching_table_structure_diff[$q], $uncommon_cols, false);
unset($add_column_array[$matching_table_structure_diff[$q]]);
@ -653,7 +653,7 @@ if (isset($_REQUEST['Table_ids'])) {
unset($delete_array[$matching_table_data_diff[$p]]);
}
PMA_addColumnsInTargetTable($src_db, $trg_db,$src_link, $trg_link,
PMA_addColumnsInTargetTable($src_db, $trg_db, $src_link, $trg_link,
$matching_tables, $source_columns, $add_column_array,
$matching_tables_fields, $criteria, $matching_tables_keys,
$target_tables_keys, $uncommon_tables, $uncommon_tables_fields,
@ -1113,7 +1113,7 @@ if (isset($_REQUEST['synchronize_db'])) {
$trg_link , $matching_tables_fields, $insert_array, $p,
$matching_tables_keys, $matching_tables_keys, $source_columns,
$add_column_array, $criteria, $target_tables_keys, $uncommon_tables,
$uncommon_tables_fields,$uncommon_cols, $alter_str_array,$source_indexes,
$uncommon_tables_fields, $uncommon_cols, $alter_str_array, $source_indexes,
$target_indexes, $add_indexes_array,
$alter_indexes_array, $delete_array, $update_array, true);
}

View File

@ -45,7 +45,7 @@ if (isset($_REQUEST['ajax_request']) && $_REQUEST['ajax_request'] == true) {
$varValue = PMA_DBI_fetch_single_row('SHOW GLOBAL VARIABLES WHERE Variable_name="' . PMA_sqlAddslashes($_REQUEST['varName']) . '";', 'NUM');
if (isset($VARIABLE_DOC_LINKS[$_REQUEST['varName']][3])
&& $VARIABLE_DOC_LINKS[$_REQUEST['varName']][3] == 'byte') {
exit(implode(' ', PMA_formatByteDown($varValue[1],3,3)));
exit(implode(' ', PMA_formatByteDown($varValue[1], 3, 3)));
}
exit($varValue[1]);
break;
@ -55,7 +55,7 @@ if (isset($_REQUEST['ajax_request']) && $_REQUEST['ajax_request'] == true) {
if (isset($VARIABLE_DOC_LINKS[$_REQUEST['varName']][3])
&& $VARIABLE_DOC_LINKS[$_REQUEST['varName']][3] == 'byte'
&& preg_match('/^\s*(\d+(\.\d+)?)\s*(mb|kb|mib|kib|gb|gib)\s*$/i',$value,$matches)) {
&& preg_match('/^\s*(\d+(\.\d+)?)\s*(mb|kb|mib|kib|gb|gib)\s*$/i', $value, $matches)) {
$exp = array('kb' => 1, 'kib' => 1, 'mb' => 2, 'mib' => 2, 'gb' => 3, 'gib' => 3);
$value = floatval($matches[1]) * pow(1024, $exp[strtolower($matches[3])]);
} else {
@ -97,7 +97,7 @@ require './libraries/server_links.inc.php';
echo '<h2>' . "\n"
. ($cfg['MainPageIconic'] ? '<img class="icon ic_s_vars" src="themes/dot.gif" alt="" />' : '')
. '' . __('Server variables and settings') . "\n"
. PMA_showMySQLDocu('server_system_variables','server_system_variables')
. PMA_showMySQLDocu('server_system_variables', 'server_system_variables')
. '</h2>' . "\n";
/**
@ -138,7 +138,7 @@ foreach ($serverVars as $name => $value) {
?>
<tr class="<?php echo $row_class; ?>">
<th nowrap="nowrap"><?php echo htmlspecialchars(str_replace('_', ' ', $name)); ?></th>
<td class="value"><?php echo formatVariable($name,$value); ?></td>
<td class="value"><?php echo formatVariable($name, $value); ?></td>
<td class="value"><?php
// To display variable documentation link
if (isset($VARIABLE_DOC_LINKS[$name]))
@ -150,7 +150,7 @@ foreach ($serverVars as $name => $value) {
</tr>
<tr class="<?php echo $odd_row ? 'odd' : 'even'; ?> ">
<td>(<?php echo __('Session value'); ?>)</td>
<td class="value"><?php echo formatVariable($name,$serverVarsSession[$name]); ?></td>
<td class="value"><?php echo formatVariable($name, $serverVarsSession[$name]); ?></td>
<td class="value"></td>
<?php } ?>
</tr>
@ -162,13 +162,13 @@ foreach ($serverVars as $name => $value) {
</table>
<?php
function formatVariable($name,$value)
function formatVariable($name, $value)
{
global $VARIABLE_DOC_LINKS;
if (is_numeric($value)) {
if (isset($VARIABLE_DOC_LINKS[$name][3]) && $VARIABLE_DOC_LINKS[$name][3]=='byte')
return '<abbr title="'.PMA_formatNumber($value, 0).'">'.implode(' ',PMA_formatByteDown($value,3,3)).'</abbr>';
return '<abbr title="'.PMA_formatNumber($value, 0).'">'.implode(' ', PMA_formatByteDown($value, 3, 3)).'</abbr>';
else return PMA_formatNumber($value, 0);
}
return htmlspecialchars($value);

View File

@ -751,7 +751,7 @@ if (0 == $num_rows || $is_affected) {
} else {
// avoid a redirect loop when last record was deleted
if (0 == $num_rows && 'sql.php' == $cfg['DefaultTabTable']) {
$goto = str_replace('sql.php','tbl_structure.php',$goto);
$goto = str_replace('sql.php', 'tbl_structure.php', $goto);
}
PMA_sendHeaderLocation($cfg['PmaAbsoluteUri'] . str_replace('&amp;', '&', $goto) . '&message=' . urlencode($message));
} // end else
@ -869,7 +869,7 @@ $(document).ready(makeProfilingChart);
echo '<div style="float: left;">';
echo '<table>' . "\n";
echo ' <tr>' . "\n";
echo ' <th>' . __('Status') . PMA_showMySQLDocu('general-thread-states','general-thread-states') . '</th>' . "\n";
echo ' <th>' . __('Status') . PMA_showMySQLDocu('general-thread-states', 'general-thread-states') . '</th>' . "\n";
echo ' <th>' . __('Time') . '</th>' . "\n";
echo ' </tr>' . "\n";
@ -877,7 +877,7 @@ $(document).ready(makeProfilingChart);
foreach ($profiling_results as $one_result) {
echo ' <tr>' . "\n";
echo '<td>' . ucwords($one_result['Status']) . '</td>' . "\n";
echo '<td align="right">' . (PMA_formatNumber($one_result['Duration'],3,1)) . 's</td>' . "\n";
echo '<td align="right">' . (PMA_formatNumber($one_result['Duration'], 3, 1)) . 's</td>' . "\n";
$chart_json[ucwords($one_result['Status'])] = $one_result['Duration'];
}

View File

@ -187,7 +187,7 @@ if (isset($_REQUEST['do_save_data'])) {
if( $GLOBALS['is_ajax_request'] == true) {
$extra_data['sql_query'] = PMA_showMessage(NULL, $sql_query);
PMA_ajaxResponse($message, $message->isSuccess(),$extra_data);
PMA_ajaxResponse($message, $message->isSuccess(), $extra_data);
}
$active_page = 'tbl_structure.php';

View File

@ -51,7 +51,7 @@ if (! empty($sql_query)) {
if (isset($where_clause) && is_array($where_clause)
&& count($where_clause) > 0) {
$wheres[] = '(' . implode(') OR (',$where_clause) . ')';
$wheres[] = '(' . implode(') OR (', $where_clause) . ')';
}
if (!empty($analyzed_sql[0]['where_clause'])) {

View File

@ -231,7 +231,7 @@ if (isset($result) && empty($message_to_show)) {
$_type = $result ? 'success' : 'error';
if ( $_REQUEST['ajax_request'] == true) {
$extra_data['sql_query'] = PMA_showMessage(NULL, $sql_query);
PMA_ajaxResponse($_message,$_message->isSuccess() ,$extra_data);
PMA_ajaxResponse($_message, $_message->isSuccess(), $extra_data);
}
}
if (! empty($warning_messages)) {

View File

@ -554,7 +554,7 @@ if ($GLOBALS['is_ajax_request'] == true) {
}
/**Get the total row count of the table*/
$extra_data['row_count'] = PMA_Table::countRecords($_REQUEST['db'],$_REQUEST['table']);
$extra_data['row_count'] = PMA_Table::countRecords($_REQUEST['db'], $_REQUEST['table']);
$extra_data['sql_query'] = PMA_showMessage($message, $GLOBALS['display_query']);
PMA_ajaxResponse($message, $message->isSuccess(), $extra_data);
}

View File

@ -153,7 +153,7 @@ echo PMA_generate_html_tabs(PMA_tbl_getSubTabs(), $url_params, '', 'topmenu2');
$foreignData = PMA_getForeignData($foreigners, $field, false, '', '');
echo PMA_getForeignFields_Values($foreigners, $foreignData, $field, $fields_type, $i, $db, $table, $titles,$GLOBALS['cfg']['ForeignKeyMaxLimit'], '', true);
echo PMA_getForeignFields_Values($foreigners, $foreignData, $field, $fields_type, $i, $db, $table, $titles, $GLOBALS['cfg']['ForeignKeyMaxLimit'], '', true);
?>
<input type="hidden" name="names[<?php echo $i; ?>]"
@ -282,7 +282,7 @@ echo PMA_generate_html_tabs(PMA_tbl_getSubTabs(), $url_params, '', 'topmenu2');
$unaryFlag = (isset($GLOBALS['cfg']['UnaryOperators'][$func_type]) && $GLOBALS['cfg']['UnaryOperators'][$func_type] == 1) ? true : false;
$tmp_geom_func = isset($geom_func[$i]) ? $geom_func[$i] : null;
$whereClause = PMA_tbl_search_getWhereClause($fields[$i],$names[$i], $types[$i], $collations[$i], $func_type, $unaryFlag, $tmp_geom_func);
$whereClause = PMA_tbl_search_getWhereClause($fields[$i], $names[$i], $types[$i], $collations[$i], $func_type, $unaryFlag, $tmp_geom_func);
if($whereClause)
$w[] = $whereClause;

View File

@ -356,7 +356,7 @@ foreach ($fields as $row) {
echo $row['Default'];
}
} else {
echo '<i>' . _pgettext('None for default','None') . '</i>';
echo '<i>' . _pgettext('None for default', 'None') . '</i>';
} ?></td>
<td nowrap="nowrap"><?php echo strtoupper($row['Extra']); ?></td>
<td align="center" class="browse">

View File

@ -104,7 +104,7 @@ if (isset($_REQUEST['report_export'])) {
// Export as file download
if (isset($_REQUEST['report_export']) && $_REQUEST['export_type'] == 'sqldumpfile') {
@ini_set('url_rewriter.tags','');
@ini_set('url_rewriter.tags', '');
$dump = "# " . sprintf(__('Tracking report for table `%s`'), htmlspecialchars($_REQUEST['table'])) . "\n" .
"# " . date('Y-m-d H:i:s') . "\n";
@ -665,7 +665,7 @@ if ($last_version > 0) {
<td><?php echo htmlspecialchars($version['date_updated']);?></td>
<td><?php echo $version_status;?></td>
<td> <a href="tbl_tracking.php<?php echo PMA_generate_common_url($url_params + array('report' => 'true', 'version' => $version['version'])
);?>"><?php echo __('Tracking report');?></a>
);?>"><?php echo __('Tracking report');?></a>
| <a href="tbl_tracking.php<?php echo PMA_generate_common_url($url_params + array('snapshot' => 'true', 'version' => $version['version'])
);?>"><?php echo __('Structure snapshot');?></a>
</td>

View File

@ -26,7 +26,7 @@ class Environment_test extends PHPUnit_Framework_TestCase
{
try{
$pdo = new PDO("mysql:host=".TESTSUITE_SERVER.";dbname=".TESTSUITE_DATABASE, TESTSUITE_USER, TESTSUITE_PASSWORD);
$this->assertNull($pdo->errorCode(),"Error when trying to connect to database");
$this->assertNull($pdo->errorCode(), "Error when trying to connect to database");
//$pdo->beginTransaction();
$test = $pdo->exec("SHOW TABLES;");

View File

@ -46,7 +46,7 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase
public function testCheckSystem()
{
$this->object->checkSystem();
$this->assertNotNull($this->object->get('PMA_VERSION'));
$this->assertNotEmpty($this->object->get('PMA_THEME_VERSION'));
$this->assertNotEmpty($this->object->get('PMA_THEME_GENERATION'));
@ -66,7 +66,7 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase
$this->object->set('PMA_USR_BROWSER_AGENT', 'MOZILLA');
$this->object->set('PMA_USR_BROWSER_VER', 5);
$this->object->checkOutputCompression();
$this->assertEquals('auto',$this->object->get("OBGzip"));
$this->assertEquals('auto', $this->object->get("OBGzip"));
ini_set('zlib.output_compression', 'Off');
$this->object->checkOutputCompression();
@ -120,15 +120,15 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase
{
$prevIsGb2Val = $this->object->get('PMA_IS_GD2');
$this->object->set('GD2Available','yes');
$this->object->set('GD2Available', 'yes');
$this->object->checkGd2();
$this->assertEquals(1, $this->object->get('PMA_IS_GD2'));
$this->object->set('GD2Available','no');
$this->object->set('GD2Available', 'no');
$this->object->checkGd2();
$this->assertEquals(0, $this->object->get('PMA_IS_GD2'));
$this->object->set('GD2Available',$prevIsGb2Val);
$this->object->set('GD2Available', $prevIsGb2Val);
if (!@function_exists('imagecreatetruecolor')) {
$this->object->checkGd2();
@ -179,7 +179,7 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase
if (defined('PHP_OS')) {
switch (PHP_OS) {
case stristr(PHP_OS,'win'):
case stristr(PHP_OS, 'win'):
$this->assertEquals(1, $this->object->get('PMA_IS_WINDOWS'), 'PHP_OS equals: ' . PHP_OS . ' PMA_IS_WINDOWS should be 1');
break;
case stristr(PHP_OS, 'OS/2'):
@ -192,7 +192,7 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase
} else {
$this->assertEquals(0, $this->object->get('PMA_IS_WINDOWS'), 'PMA_IS_WINDOWS Default to Unix or Equiv');
define('PHP_OS','Windows');
define('PHP_OS', 'Windows');
$this->assertEquals(1, $this->object->get('PMA_IS_WINDOWS'), 'PMA_IS_WINDOWS must be 1');
}
}
@ -247,7 +247,7 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase
$expectedSettings = PMA_array_merge_recursive($this->object->settings, $loadedConf);
$this->assertEquals($expectedSettings, $this->object->settings,'Settings loaded wrong');
$this->assertEquals($expectedSettings, $this->object->settings, 'Settings loaded wrong');
$this->assertFalse($this->object->error_config_default_file);
}
@ -298,7 +298,7 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase
public function testCheckPmaAbsoluteUriEmpty()
{
$this->object->set('PmaAbsoluteUri','');
$this->object->set('PmaAbsoluteUri', '');
$this->assertFalse($this->object->checkPmaAbsoluteUri(), 'PmaAbsoluteUri is not set and should be error');
$this->assertTrue($this->object->error_pma_uri, 'PmaAbsoluteUri is not set and should be error');
}
@ -308,11 +308,11 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase
*/
public function testCheckPmaAbsoluteUriNormal()
{
$this->object->set('PmaAbsoluteUri','http://localhost/phpmyadmin/');
$this->object->set('PmaAbsoluteUri', 'http://localhost/phpmyadmin/');
$this->object->checkPmaAbsoluteUri();
$this->assertEquals("http://localhost/phpmyadmin/", $this->object->get('PmaAbsoluteUri'));
$this->object->set('PmaAbsoluteUri','http://localhost/phpmyadmin');
$this->object->set('PmaAbsoluteUri', 'http://localhost/phpmyadmin');
$this->object->checkPmaAbsoluteUri();
$this->assertEquals("http://localhost/phpmyadmin/", $this->object->get('PmaAbsoluteUri'), 'Expected trailing slash at the end of the phpMyAdmin uri');
@ -328,7 +328,7 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase
$_SERVER['HTTPS'] = 'off';
$GLOBALS['PMA_PHP_SELF'] = 'index.php';
$this->object->set('PmaAbsoluteUri','');
$this->object->set('PmaAbsoluteUri', '');
$this->object->checkPmaAbsoluteUri();
$this->assertEquals("http://localhost/", $this->object->get('PmaAbsoluteUri'));
@ -339,12 +339,12 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase
*/
public function testCheckPmaAbsoluteUriUser()
{
$this->object->set('PmaAbsoluteUri','http://user:pwd@localhost/phpmyadmin/index.php');
$this->object->set('PmaAbsoluteUri', 'http://user:pwd@localhost/phpmyadmin/index.php');
$this->object->checkPmaAbsoluteUri();
$this->assertEquals("http://user:pwd@localhost/phpmyadmin/index.php/", $this->object->get('PmaAbsoluteUri'));
$this->object->set('PmaAbsoluteUri','https://user:pwd@localhost/phpmyadmin/index.php');
$this->object->set('PmaAbsoluteUri', 'https://user:pwd@localhost/phpmyadmin/index.php');
$this->object->checkPmaAbsoluteUri();
$this->assertEquals("https://user:pwd@localhost/phpmyadmin/index.php/", $this->object->get('PmaAbsoluteUri'));
@ -400,7 +400,7 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase
{
$this->object->checkCookiePath();
echo $this->object->get('cookie_path');
$this->assertEquals('',$this->object->get('cookie_path'));
$this->assertEquals('', $this->object->get('cookie_path'));
}
/**
@ -546,7 +546,7 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase
public function testSetUserValue()
{
$this->object->setUserValue(null, 'lang', $GLOBALS['lang'], 'en');
$this->object->setUserValue("TEST_COOKIE_USER_VAL",'','cfg_val_1');
$this->object->setUserValue("TEST_COOKIE_USER_VAL", '', 'cfg_val_1');
// Remove the following lines when you implement this test.
// $this->markTestIncomplete(

View File

@ -22,7 +22,7 @@ class PMA_contains_nonprintable_ascii extends PHPUnit_Framework_TestCase
array("new\nline", 1),
array("tab\tspace", 1),
array("escape" . chr(27) . "char", 1),
array("chars%$\r\n",1),
array("chars%$\r\n", 1),
);
}
@ -30,7 +30,7 @@ class PMA_contains_nonprintable_ascii extends PHPUnit_Framework_TestCase
* @dataProvider dataProvider
*/
function testContainsNonPrintableAscii($str, $res){
$this->assertEquals($res,PMA_contains_nonprintable_ascii($str));
$this->assertEquals($res, PMA_contains_nonprintable_ascii($str));
}
}

View File

@ -21,7 +21,7 @@ class PMA_display_html_checkbox_test extends PHPUnit_Extensions_OutputTestCase
$label = "text_label_for_checkbox";
$this->expectOutputString('<input type="checkbox" name="' . $name . '" id="' . $name . '" /><label for="' . $name . '">' . $label . '</label>');
PMA_display_html_checkbox($name,$label,false,false);
PMA_display_html_checkbox($name, $label, false, false);
}
function testDisplayHtmlCheckboxChecked()
@ -30,7 +30,7 @@ class PMA_display_html_checkbox_test extends PHPUnit_Extensions_OutputTestCase
$label = "text_label_for_checkbox";
$this->expectOutputString('<input type="checkbox" name="' . $name . '" id="' . $name . '" checked="checked" /><label for="' . $name . '">' . $label . '</label>');
PMA_display_html_checkbox($name,$label,true,false);
PMA_display_html_checkbox($name, $label, true, false);
}
function testDisplayHtmlCheckboxOnclick()
@ -39,7 +39,7 @@ class PMA_display_html_checkbox_test extends PHPUnit_Extensions_OutputTestCase
$label = "text_label_for_checkbox";
$this->expectOutputString('<input type="checkbox" name="' . $name . '" id="' . $name . '" class="autosubmit" /><label for="' . $name . '">' . $label . '</label>');
PMA_display_html_checkbox($name,$label,false,true);
PMA_display_html_checkbox($name, $label, false, true);
}
function testDisplayHtmlCheckboxCheckedOnclick()
@ -48,7 +48,7 @@ class PMA_display_html_checkbox_test extends PHPUnit_Extensions_OutputTestCase
$label = "text_label_for_checkbox";
$this->expectOutputString('<input type="checkbox" name="' . $name . '" id="' . $name . '" checked="checked" class="autosubmit" /><label for="' . $name . '">' . $label . '</label>');
PMA_display_html_checkbox($name,$label,true,true);
PMA_display_html_checkbox($name, $label, true, true);
}
}

View File

@ -21,7 +21,7 @@ class PMA_display_html_radio_test extends PHPUnit_Extensions_OutputTestCase
$choices = array();
$this->expectOutputString("");
PMA_display_html_radio($name,$choices);
PMA_display_html_radio($name, $choices);
}
function testDisplayHtmlRadio()
@ -40,7 +40,7 @@ class PMA_display_html_radio_test extends PHPUnit_Extensions_OutputTestCase
}
$this->expectOutputString($out);
PMA_display_html_radio($name,$choices);
PMA_display_html_radio($name, $choices);
}
function testDisplayHtmlRadioWithChecked()
@ -63,7 +63,7 @@ class PMA_display_html_radio_test extends PHPUnit_Extensions_OutputTestCase
}
$this->expectOutputString($out);
PMA_display_html_radio($name,$choices,$checked_choice);
PMA_display_html_radio($name, $choices, $checked_choice);
}
function testDisplayHtmlRadioWithCheckedWithClass()
@ -89,7 +89,7 @@ class PMA_display_html_radio_test extends PHPUnit_Extensions_OutputTestCase
}
$this->expectOutputString($out);
PMA_display_html_radio($name,$choices,$checked_choice,true,false,$class);
PMA_display_html_radio($name, $choices, $checked_choice, true, false, $class);
}
function testDisplayHtmlRadioWithoutBR()
@ -111,7 +111,7 @@ class PMA_display_html_radio_test extends PHPUnit_Extensions_OutputTestCase
}
$this->expectOutputString($out);
PMA_display_html_radio($name,$choices,$checked_choice,false);
PMA_display_html_radio($name, $choices, $checked_choice, false);
}
function testDisplayHtmlRadioEscapeLabelEscapeLabel()
@ -134,7 +134,7 @@ class PMA_display_html_radio_test extends PHPUnit_Extensions_OutputTestCase
}
$this->expectOutputString($out);
PMA_display_html_radio($name,$choices,$checked_choice,true,true);
PMA_display_html_radio($name, $choices, $checked_choice, true, true);
}
function testDisplayHtmlRadioEscapeLabelNotEscapeLabel()
@ -157,7 +157,7 @@ class PMA_display_html_radio_test extends PHPUnit_Extensions_OutputTestCase
}
$this->expectOutputString($out);
PMA_display_html_radio($name,$choices,$checked_choice,true,false);
PMA_display_html_radio($name, $choices, $checked_choice, true, false);
}
function testDisplayHtmlRadioEscapeLabelEscapeLabelWithClass()
@ -183,6 +183,6 @@ class PMA_display_html_radio_test extends PHPUnit_Extensions_OutputTestCase
}
$this->expectOutputString($out);
PMA_display_html_radio($name,$choices,$checked_choice,true,true,$class);
PMA_display_html_radio($name, $choices, $checked_choice, true, true, $class);
}
}

View File

@ -18,21 +18,21 @@ class PMA_extractValueFromFormattedSize_test extends PHPUnit_Framework_TestCase
function testExtractValueFromFormattedSizeNoFormat(){
$this->assertEquals(-1,PMA_extractValueFromFormattedSize(100));
$this->assertEquals(-1, PMA_extractValueFromFormattedSize(100));
}
function testExtractValueFromFormattedSizeGB(){
$this->assertEquals(10737418240,PMA_extractValueFromFormattedSize("10GB"));
$this->assertEquals(10737418240, PMA_extractValueFromFormattedSize("10GB"));
}
function testExtractValueFromFormattedSizeMB(){
$this->assertEquals(15728640,PMA_extractValueFromFormattedSize("15MB"));
$this->assertEquals(15728640, PMA_extractValueFromFormattedSize("15MB"));
}
function testExtractValueFromFormattedSizeK(){
$this->assertEquals(262144,PMA_extractValueFromFormattedSize("256K"));
$this->assertEquals(262144, PMA_extractValueFromFormattedSize("256K"));
}
}

View File

@ -47,7 +47,7 @@ class PMA_formatSql_test extends PHPUnit_Framework_TestCase
global $cfg;
$cfg['SQP']['fmtType'] = 'html';
$sql = "SELECT * FROM tTable;";
$this->assertEquals("<pre>\n$sql\n</pre>",PMA_formatSql($sql));
$this->assertEquals("<pre>\n$sql\n</pre>", PMA_formatSql($sql));
}
function testFormatSQLfmTypeHtml_1(){
@ -81,7 +81,7 @@ class PMA_formatSql_test extends PHPUnit_Framework_TestCase
$unparsed = "SELECT 1;";
$expected = '<span class="syntax"><span class="inner_sql"><span class="syntax_alpha syntax_alpha_reservedWord">SELECT</span></a> <span class="syntax_digit syntax_digit_integer">1</span> <span class="syntax_punct syntax_punct_queryend">;</span><br /><br /></span></span>';
$this->assertEquals($expected,PMA_formatSql($sql, $unparsed));
$this->assertEquals($expected, PMA_formatSql($sql, $unparsed));
}
function testFormatSQLfmTypeHtml_2(){
@ -128,7 +128,7 @@ class PMA_formatSql_test extends PHPUnit_Framework_TestCase
);
$expected = '<span class="syntax"><span class="inner_sql"><span class="syntax_alpha syntax_alpha_reservedWord">SELECT</span></a> <span class="syntax_punct">*</span> <br /><span class="syntax_alpha syntax_alpha_reservedWord">FROM</span> <span class="syntax_quote syntax_quote_backtick">`tTable`</span> <span class="syntax_punct syntax_punct_queryend">;</span><br /><br /></span></span>';
$this->assertEquals($expected,PMA_formatSql($sql, $unparsed));
$this->assertEquals($expected, PMA_formatSql($sql, $unparsed));
}
function testFormatSQLfmTypeHtml_3(){
@ -263,7 +263,7 @@ class PMA_formatSql_test extends PHPUnit_Framework_TestCase
$expected = '<span class="syntax"><span class="inner_sql"><span class="syntax_alpha syntax_alpha_reservedWord">SELECT</span></a> <span class="syntax_punct">*</span> <br /><span class="syntax_alpha syntax_alpha_reservedWord">FROM</span> <span class="syntax_quote syntax_quote_backtick">`tTable_A`</span> <span class="syntax_alpha syntax_alpha_identifier">A</span><br /><span class="syntax_alpha syntax_alpha_reservedWord">INNER</span> <span class="syntax_alpha syntax_alpha_reservedWord">JOIN</span> <span class="syntax_quote syntax_quote_backtick">`tTable_B`</span> <span class="syntax_alpha syntax_alpha_identifier">B</span> <span class="syntax_alpha syntax_alpha_reservedWord">ON</span> <span class="syntax_alpha syntax_alpha_identifier">B</span><span class="syntax_punct syntax_punct_qualifier">.</span><span class="syntax_alpha syntax_alpha_identifier">ID</span> <span class="syntax_punct">=</span></a> <span class="syntax_alpha syntax_alpha_identifier">A</span><span class="syntax_punct syntax_punct_qualifier">.</span><span class="syntax_alpha syntax_alpha_identifier">ID</span><span class="syntax_punct syntax_punct_queryend">;</span><br /><br /></span></span>';
$this->assertEquals($expected,PMA_formatSql($sql, $unparsed));
$this->assertEquals($expected, PMA_formatSql($sql, $unparsed));
}
function testFormatSQLfmTypeText_1(){
@ -297,7 +297,7 @@ class PMA_formatSql_test extends PHPUnit_Framework_TestCase
$unparsed = "SELECT 1;";
$expected = '<span class="inner_sql">SELECT</a> 1 ;<br /><br /></span>';
$this->assertEquals($expected,PMA_formatSql($sql, $unparsed));
$this->assertEquals($expected, PMA_formatSql($sql, $unparsed));
}
function testFormatSQLfmTypeText_2(){
@ -344,7 +344,7 @@ class PMA_formatSql_test extends PHPUnit_Framework_TestCase
);
$expected = '<span class="inner_sql">SELECT</a> * <br />FROM `tTable` ;<br /><br /></span>';
$this->assertEquals($expected,PMA_formatSql($sql, $unparsed));
$this->assertEquals($expected, PMA_formatSql($sql, $unparsed));
}
function testFormatSQLfmTypeText_3(){
@ -478,7 +478,7 @@ class PMA_formatSql_test extends PHPUnit_Framework_TestCase
);
$expected = '<span class="inner_sql">SELECT</a> * <br />FROM `tTable_A` A<br />INNER JOIN `tTable_B` B ON B.ID =</a> A.ID;<br /><br /></span>';
$this->assertEquals($expected,PMA_formatSql($sql, $unparsed));
$this->assertEquals($expected, PMA_formatSql($sql, $unparsed));
}
function testFormatSQLfmTypeNone_1(){
@ -512,10 +512,10 @@ class PMA_formatSql_test extends PHPUnit_Framework_TestCase
$unparsed = "SELECT 1;";
$expected = "<span class=\"inner_sql\"><pre>\nSELECT 1;\n</pre></span>";
$this->assertEquals($expected,PMA_formatSql($sql, $unparsed));
$this->assertEquals($expected, PMA_formatSql($sql, $unparsed));
$expected = "SELECT 1;";
$this->assertEquals($expected,PMA_formatSql($sql));
$this->assertEquals($expected, PMA_formatSql($sql));
}
function testFormatSQLfmTypeNone_2(){
@ -562,10 +562,10 @@ class PMA_formatSql_test extends PHPUnit_Framework_TestCase
);
$expected = "<span class=\"inner_sql\"><pre>\nSELECT * from `tTable`;\n</pre></span>";
$this->assertEquals($expected,PMA_formatSql($sql, $unparsed));
$this->assertEquals($expected, PMA_formatSql($sql, $unparsed));
$expected = "SELECT * from `tTable`;";
$this->assertEquals($expected,PMA_formatSql($sql));
$this->assertEquals($expected, PMA_formatSql($sql));
}
function testFormatSQLfmTypeNone_3(){
@ -699,10 +699,10 @@ class PMA_formatSql_test extends PHPUnit_Framework_TestCase
);
$expected = "<span class=\"inner_sql\"><pre>\nSELECT * FROM `tTable_A` A INNER JOIN `tTable_B` B ON B.ID = A.ID;\n</pre></span>";
$this->assertEquals($expected,PMA_formatSql($sql, $unparsed));
$this->assertEquals($expected, PMA_formatSql($sql, $unparsed));
$expected = 'SELECT * FROM `tTable_A` A INNER JOIN `tTable_B` B ON B.ID = A.ID;';
$this->assertEquals($expected,PMA_formatSql($sql));
$this->assertEquals($expected, PMA_formatSql($sql));
}
function testFormatSQLWithoutType(){
@ -739,7 +739,7 @@ class PMA_formatSql_test extends PHPUnit_Framework_TestCase
global $SQP_errorString;
$SQP_errorString = true;
$sql = array("raw" => "& \" < >");
$this->assertEquals("&amp; &quot; &lt; &gt;",PMA_formatSql($sql));
$this->assertEquals("&amp; &quot; &lt; &gt;", PMA_formatSql($sql));
$SQP_errorString = false;
}
}

View File

@ -24,7 +24,7 @@ class PMA_generate_html_dropdown_test extends PHPUnit_Framework_TestCase
$result = '<select name="' . htmlspecialchars($name) . '" id="' . htmlspecialchars($id) . '"></select>';
$this->assertEquals($result, PMA_generate_html_dropdown($name,$choices,$active_choice,$id));
$this->assertEquals($result, PMA_generate_html_dropdown($name, $choices, $active_choice, $id));
}
function testGenerateHtmlDropdown()
@ -44,7 +44,7 @@ class PMA_generate_html_dropdown_test extends PHPUnit_Framework_TestCase
}
$result .= '</select>';
$this->assertEquals($result, PMA_generate_html_dropdown($name,$choices,$active_choice,$id));
$this->assertEquals($result, PMA_generate_html_dropdown($name, $choices, $active_choice, $id));
}
function testGenerateHtmlDropdownWithActive()
@ -64,6 +64,6 @@ class PMA_generate_html_dropdown_test extends PHPUnit_Framework_TestCase
}
$result .= '</select>';
$this->assertEquals($result, PMA_generate_html_dropdown($name,$choices,$active_choice,$id));
$this->assertEquals($result, PMA_generate_html_dropdown($name, $choices, $active_choice, $id));
}
}

View File

@ -24,7 +24,7 @@ class PMA_generate_slider_effect_test extends PHPUnit_Extensions_OutputTestCase
$message = "test_message";
$this->expectOutputString('<div id="' . $id . '" class="pma_auto_slider" title="' . htmlspecialchars($message) . '">' . "\n" . ' ');
PMA_generate_slider_effect($id,$message);
PMA_generate_slider_effect($id, $message);
}
function testGenerateSliderEffectTestClosed()
@ -36,7 +36,7 @@ class PMA_generate_slider_effect_test extends PHPUnit_Extensions_OutputTestCase
$message = "test_message";
$this->expectOutputString('<div id="' . $id . '" style="display: none; overflow:auto;" class="pma_auto_slider" title="' . htmlspecialchars($message) . '">' . "\n" . ' ');
PMA_generate_slider_effect($id,$message);
PMA_generate_slider_effect($id, $message);
}
function testGenerateSliderEffectTestDisabled()
@ -48,6 +48,6 @@ class PMA_generate_slider_effect_test extends PHPUnit_Extensions_OutputTestCase
$message = "test_message";
$this->expectOutputString('<div id="' . $id . '">');
PMA_generate_slider_effect($id,$message);
PMA_generate_slider_effect($id, $message);
}
}

View File

@ -41,7 +41,7 @@ class PMA_getDbLink_test extends PHPUnit_Framework_TestCase
$database = $GLOBALS['db'];
$this->assertEquals('<a href="' . $cfg['DefaultTabDatabase'] . '?db=' . $database
. '&amp;server=99&amp;lang=en&amp;token=token" title="Jump to database &quot;' . htmlspecialchars($database) . '&quot;.">'
. htmlspecialchars($database) . '</a>',PMA_getDbLink());
. htmlspecialchars($database) . '</a>', PMA_getDbLink());
}
function testGetDbLink()
@ -50,7 +50,7 @@ class PMA_getDbLink_test extends PHPUnit_Framework_TestCase
$database = 'test_database';
$this->assertEquals('<a href="' . $cfg['DefaultTabDatabase'] . '?db=' . $database
. '&amp;server=99&amp;lang=en&amp;token=token" title="Jump to database &quot;' . htmlspecialchars($database) . '&quot;.">'
. htmlspecialchars($database) . '</a>',PMA_getDbLink($database));
. htmlspecialchars($database) . '</a>', PMA_getDbLink($database));
}
function testGetDbLinkWithSpecialChars()
@ -59,6 +59,6 @@ class PMA_getDbLink_test extends PHPUnit_Framework_TestCase
$database = 'test&data\'base';
$this->assertEquals('<a href="' . $cfg['DefaultTabDatabase'] . '?db=' . htmlspecialchars(urlencode($database))
. '&amp;server=99&amp;lang=en&amp;token=token" title="Jump to database &quot;' . htmlspecialchars($database) . '&quot;.">'
. htmlspecialchars($database) . '</a>',PMA_getDbLink($database));
. htmlspecialchars($database) . '</a>', PMA_getDbLink($database));
}
}

View File

@ -36,7 +36,7 @@ class PMA_getTitleForTarget_test extends PHPUnit_Framework_TestCase
*/
function testGetTitleForTarget($target, $result){
$this->assertEquals($result,PMA_getTitleForTarget($target));
$this->assertEquals($result, PMA_getTitleForTarget($target));
}
}

View File

@ -185,7 +185,7 @@ class PMA_array_test extends PHPUnit_Framework_TestCase
}
$arr = array(1, 2, 3, 4);
$target = array('val: 1 processed','val: 2 processed','val: 3 processed','val: 4 processed');
$target = array('val: 1 processed', 'val: 2 processed', 'val: 3 processed', 'val: 4 processed');
PMA_arrayWalkRecursive($arr, 'fConcat');
$this->assertEquals($arr, $target);
@ -213,8 +213,8 @@ class PMA_array_test extends PHPUnit_Framework_TestCase
*/
function testPMA_arrayWalkRecursiveSubArray()
{
$arr = array("key1"=>'val1', 'key2'=>array('skey1'=>'sval1','skey2'=>'sval2'),'key3'=>'val3');
$target = array('key1'=>'val: val1 processed', 'key2'=> array('skey1'=>'val: sval1 processed', 'skey2'=>'val: sval2 processed'),'key3'=>'val: val3 processed');
$arr = array("key1"=>'val1', 'key2'=>array('skey1'=>'sval1', 'skey2'=>'sval2'), 'key3'=>'val3');
$target = array('key1'=>'val: val1 processed', 'key2'=> array('skey1'=>'val: sval1 processed', 'skey2'=>'val: sval2 processed'), 'key3'=>'val: val3 processed');
PMA_arrayWalkRecursive($arr, 'fConcat');
$this->assertEquals($arr, $target);
@ -222,10 +222,10 @@ class PMA_array_test extends PHPUnit_Framework_TestCase
function testPMA_arrayWalkRecursiveApplyToKeysStripSlashes()
{
$arr = array("key\\1"=>'v\\\\al1', 'k\\ey2'=>array('s\\\\key1'=>'sval\\1','s\\k\\ey2'=>'s\\v\\al2'),'key3'=>'val3');
$target = array("key1"=>'val1', 'key2'=>array('skey1'=>'sval1','skey2'=>'sval2'),'key3'=>'val3');
$arr = array("key\\1"=>'v\\\\al1', 'k\\ey2'=>array('s\\\\key1'=>'sval\\1', 's\\k\\ey2'=>'s\\v\\al2'), 'key3'=>'val3');
$target = array("key1"=>'val1', 'key2'=>array('skey1'=>'sval1', 'skey2'=>'sval2'), 'key3'=>'val3');
PMA_arrayWalkRecursive($arr, 'stripslashes',true);
PMA_arrayWalkRecursive($arr, 'stripslashes', true);
$this->assertEquals($arr, $target);
}
}

View File

@ -37,31 +37,31 @@ class PMA_checkPageValidity_test extends PHPUnit_Framework_TestCase
function testGotoNowhere(){
$page = null;
$this->assertFalse(PMA_checkPageValidity($page,null));
$this->assertFalse(PMA_checkPageValidity($page, null));
}
function testGotoWhitelist(){
$page = 'export.php';
$this->assertTrue(PMA_checkPageValidity($page,$this->goto_whitelist));
$this->assertTrue(PMA_checkPageValidity($page, $this->goto_whitelist));
}
function testGotoNotInWhitelist(){
$page = 'shell.php';
$this->assertFalse(PMA_checkPageValidity($page,$this->goto_whitelist));
$this->assertFalse(PMA_checkPageValidity($page, $this->goto_whitelist));
}
function testGotoWhitelistPage(){
$page = 'main.php?sql.php&test=true';
$this->assertTrue(PMA_checkPageValidity($page,$this->goto_whitelist));
$this->assertTrue(PMA_checkPageValidity($page, $this->goto_whitelist));
}
function testGotoWhitelistEncodedPage(){
$page = 'main.php%3Fsql.php%26test%3Dtrue';
$this->assertTrue(PMA_checkPageValidity($page,$this->goto_whitelist));
$this->assertTrue(PMA_checkPageValidity($page, $this->goto_whitelist));
}
}

View File

@ -31,7 +31,7 @@ class PMA_getTableCount_test extends PHPUnit_Framework_TestCase
$GLOBALS['cfg']['Server']['host'] = 'localhost';
$GLOBALS['cfg']['Server']['user'] = 'root';
$this->assertEquals(5,PMA_getTableCount('meddb'));
$this->assertEquals(5, PMA_getTableCount('meddb'));
$this->assertTrue(true);
}
}

View File

@ -70,9 +70,9 @@ class PMA_headerLocation_test extends PHPUnit_Extensions_OutputTestCase
foreach ($substs as $func => $ren_func) {
if (function_exists("__overridden__"))
rename_function("__overridden__", str_replace(array('.', ' '),array('', ''),microtime()));
rename_function("__overridden__", str_replace(array('.', ' '), array('', ''), microtime()));
override_function($func, $args[$func], $substs[$func]);
rename_function("__overridden__", str_replace(array('.', ' '),array('', ''),microtime()));
rename_function("__overridden__", str_replace(array('.', ' '), array('', ''), microtime()));
}
}
@ -85,8 +85,8 @@ class PMA_headerLocation_test extends PHPUnit_Extensions_OutputTestCase
if ($this->apdExt && $GLOBALS['test_header']) {
$GLOBALS['test_header'] = 0;
rename_function('header', 'header'.str_replace(array('.', ' '),array('', ''),microtime()));
rename_function('headers_sent', 'headers_sent'.str_replace(array('.', ' '),array('', ''),microtime()));
rename_function('header', 'header'.str_replace(array('.', ' '), array('', ''), microtime()));
rename_function('headers_sent', 'headers_sent'.str_replace(array('.', ' '), array('', ''), microtime()));
rename_function('test_header', 'header');
rename_function('test_headers_sent', 'headers_sent');

View File

@ -27,11 +27,11 @@ class PMA_warnMissingExtension_test extends PHPUnit_Framework_TestCase
$warn = 'The <a href="'.PMA_linkURL(PMA_getPHPDocLink('book.' . $ext . '.php')).'" target="Documentation"><em>'.$ext.'</em></a> extension is missing. Please check your PHP configuration.';
ob_start();
PMA_warnMissingExtension($ext,true);
PMA_warnMissingExtension($ext, true);
$printed = ob_get_contents();
ob_end_clean();
$this->assertGreaterThan(0,strpos($printed,$warn));
$this->assertGreaterThan(0, strpos($printed, $warn));
}
function testMissingExtentionFatalWithExtra(){
@ -41,11 +41,11 @@ class PMA_warnMissingExtension_test extends PHPUnit_Framework_TestCase
$warn = 'The <a href="'.PMA_linkURL(PMA_getPHPDocLink('book.' . $ext . '.php')).'" target="Documentation"><em>'.$ext.'</em></a> extension is missing. Please check your PHP configuration.'.' '.$extra;
ob_start();
PMA_warnMissingExtension($ext,true,$extra);
PMA_warnMissingExtension($ext, true, $extra);
$printed = ob_get_contents();
ob_end_clean();
$this->assertGreaterThan(0,strpos($printed,$warn));
$this->assertGreaterThan(0, strpos($printed, $warn));
}
function testMissingExtentionWithExtra(){
@ -53,7 +53,7 @@ class PMA_warnMissingExtension_test extends PHPUnit_Framework_TestCase
$extra = 'Appended Extra String';
$this->setExpectedException('PHPUnit_Framework_Error',
'The [a@'.PMA_getPHPDocLink('book.' . $ext . '.php').'@Documentation][em]'.$ext.'[/em][/a] extension is missing. Please check your PHP configuration.'.' '.$extra);
PMA_warnMissingExtension($ext,false,$extra);
PMA_warnMissingExtension($ext, false, $extra);
$this->assertTrue(true);
}
}