The branch, STABLE has been updated via 7ae21e87672008b64b476d111ea542891f9c03fc (commit) via 3e31ab117262a1d36c5dd0d57d9ec823289d20f9 (commit) via a80d0892f8c584aaf8e4cf3f505b178cfd82be51 (commit) via e71bd6ae1a45cf9044145e11db10dea510e59f92 (commit) via c722cf64a32c7a29ef3ad59ec005a5a2a63de51e (commit) via e905d0bbcc9bf4ce404e48e9dd8a7aadb0f3ab46 (commit) via e1653263885f3d40cbf67747434b1d17bb90622b (commit) via 6e750d1d483ea13ec690674cc17e1c6f15a5d2bb (commit) via ae9b95f6a7bab512d84e033126cf9d81c374820b (commit) via de17abec0ddd388b184b500eaa7cd196d6a73f91 (commit) via e8ac45b7249684f7f77e426d3a2d166dc10d748e (commit) via 09b124c2723c5bf28404d800f7f8940d18cfc8dd (commit) via 4c8c7080a76b837ae55cdc5e010c793b389a671a (commit) via df97b1d2c075a0db4241b8494e36fa85eb231dcf (commit) via 31cd4bdd6a7c42527b2011201d378e3c9accce8a (commit) via 824458981388fbaad52c0e1d11db4c681bf03789 (commit) via 6135612dbb1150c6a0a6287246c8103ee637de93 (commit) via 6b91d2ef54d15ee56662859abaf0b4795f7293c7 (commit) via 9ebd401b0ea4efea8ddc8cd846da559bf420ccaa (commit) via 8928900532d111e849362b6359571a3b079eb9ea (commit) via 066b746befdacf10d87f2eaf3de8ee68f745a447 (commit) via ba2326d7033e12b4ac134cbb585f016203a93517 (commit) via 18f50cc043ed16114096b86de56335c3c78c8ad2 (commit) via a022d7aa59fbf910626bbebcd9617c95a6c5f5d8 (commit) via abbbd192bfd054545d53600bcbc06be3bce7fbf1 (commit) from d626c51926d1ff71a359981ffbab55f649e54665 (commit)
- Log ----------------------------------------------------------------- commit 7ae21e87672008b64b476d111ea542891f9c03fc Merge: d626c51926d1ff71a359981ffbab55f649e54665 3e31ab117262a1d36c5dd0d57d9ec823289d20f9 Author: Marc Delisle marc@infomarc.info Date: Sat Mar 19 08:01:09 2011 -0400
Merge branch 'MAINT_3_3_10' into STABLE
-----------------------------------------------------------------------
Summary of changes: .gitignore | 8 +++ ChangeLog | 10 ++++ Documentation.html | 4 +- README | 4 +- db_structure.php | 2 + error.php | 90 ---------------------------------- lang/german-utf-8.inc.php | 30 +++++------- libraries/Config.class.php | 2 +- libraries/common.inc.php | 1 - libraries/core.lib.php | 15 ++--- libraries/database_interface.lib.php | 16 +++++-- libraries/dbi/mysql.dbi.lib.php | 28 ++++++++-- libraries/dbi/mysqli.dbi.lib.php | 25 ++++++++-- libraries/error.inc.php | 57 +++++++++++++++++++++ libraries/export/yaml.php | 7 +-- libraries/relation.lib.php | 10 +++- phpinfo.php | 4 -- tbl_replace.php | 2 +- themes/.gitignore | 1 + translators.html | 4 +- 20 files changed, 169 insertions(+), 151 deletions(-) delete mode 100644 error.php create mode 100644 libraries/error.inc.php
diff --git a/.gitignore b/.gitignore index 8a1aa74..a773f8e 100644 --- a/.gitignore +++ b/.gitignore @@ -19,5 +19,13 @@ phpmyadmin.wpj .settings .buildpath .cache +.idea *.sw[op] +# Locales locale +# Backups +*~ +# Javascript sources +sources +# API documentation +apidoc diff --git a/ChangeLog b/ChangeLog index 5b48a06..e42d62d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,16 @@ phpMyAdmin - ChangeLog $Id$ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyAdmin/C... $
+3.3.10.0 (2011-03-19) +- patch #3147400 [structure] Aria table size printed as unknown, + thanks to erickoh75 - erickoh75 +- patch #3150164 [structure] Ordering by size gives incorrect results, + thanks to Madhura Jayaratne - madhuracj +- bug #3153409 [core] 0 row(s) affected +- bug #3155842 [core] Edit relational page and page number +- [security] Minor security fixes, see PMASA-2010-9 and PMASA-2010-10 +- [lang] German update, thanks to to jannicars@users.sourceforge.net. + 3.3.9.2 (2011-02-11) - [security] SQL injection, see PMASA-2011-2
diff --git a/Documentation.html b/Documentation.html index faffa0c..5b596c1 100644 --- a/Documentation.html +++ b/Documentation.html @@ -10,7 +10,7 @@ vim: expandtab ts=4 sw=4 sts=4 tw=78 <link rel="icon" href="./favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <title>phpMyAdmin 3.3.9.2 - Documentation</title> + <title>phpMyAdmin 3.3.10 - Documentation</title> <link rel="stylesheet" type="text/css" href="docs.css" /> </head>
@@ -18,7 +18,7 @@ vim: expandtab ts=4 sw=4 sts=4 tw=78 <div id="header"> <h1> <a href="http://www.phpmyadmin.net/">php<span class="myadmin">MyAdmin</span></a> - 3.3.9.2 + 3.3.10 Documentation </h1> </div> diff --git a/README b/README index 2318189..00e24a8 100644 --- a/README +++ b/README @@ -5,8 +5,8 @@ phpMyAdmin - Readme
A set of PHP-scripts to manage MySQL over the web.
- Version 3.3.9.2 - --------------- + Version 3.3.10 + -------------- http://www.phpmyadmin.net/
Copyright (C) 1998-2000 Tobias Ratschiller <tobias_at_ratschiller.com> diff --git a/db_structure.php b/db_structure.php index 7e5d70f..898bea8 100644 --- a/db_structure.php +++ b/db_structure.php @@ -199,6 +199,8 @@ foreach ($tables as $keyname => $each_table) { case 'HEAP' : case 'MEMORY' : case 'ARCHIVE' : + case 'Aria' : + case 'Maria' : if ($db_is_information_schema) { $each_table['Rows'] = PMA_Table::countRecords($db, $each_table['Name']); diff --git a/error.php b/error.php deleted file mode 100644 index 7e86ffb..0000000 --- a/error.php +++ /dev/null @@ -1,90 +0,0 @@ -<?php -/* vim: set expandtab sw=4 ts=4 sts=4: */ -/** - * phpMyAdmin fatal error display page - * - * @version $Id$ - * @package phpMyAdmin - */ - -/** - * Input sanitizing. - */ -require_once './libraries/sanitizing.lib.php'; - -/* Get variables */ -if (! empty($_REQUEST['lang']) && is_string($_REQUEST['lang'])) { - $lang = htmlspecialchars($_REQUEST['lang']); -} else { - $lang = 'en'; -} - -if (! empty($_REQUEST['dir']) && is_string($_REQUEST['dir'])) { - $dir = htmlspecialchars($_REQUEST['dir']); -} else { - $dir = 'ltr'; -} - -if (! empty($_REQUEST['type']) && is_string($_REQUEST['type'])) { - $type = htmlspecialchars($_REQUEST['type']); -} else { - $type = 'error'; -} - -// force utf-8 to avoid XSS with crafted URL and utf-7 in charset parameter -$charset = 'utf-8'; - -header('Content-Type: text/html; charset=' . $charset); -?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $lang; ?>" dir="<?php echo $dir; ?>"> -<head> - <link rel="icon" href="./favicon.ico" type="image/x-icon" /> - <link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" /> - <title>phpMyAdmin</title> - <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset; ?>" /> - <style type="text/css"> - <!-- - html { - padding: 0; - margin: 0; - } - body { - font-family: sans-serif; - font-size: small; - color: #000000; - background-color: #F5F5F5; - margin: 1em; - } - h1 { - margin: 0; - padding: 0.3em; - font-size: 1.4em; - font-weight: bold; - color: #ffffff; - background-color: #ff0000; - } - p { - margin: 0; - padding: 0.5em; - border: 0.1em solid red; - background-color: #ffeeee; - } - //--> - </style> -</head> -<body> -<h1>phpMyAdmin - <?php echo $type; ?></h1> -<p><?php -if (!empty($_REQUEST['error'])) { - if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) { - echo PMA_sanitize(stripslashes($_REQUEST['error'])); - } else { - echo PMA_sanitize($_REQUEST['error']); - } -} else { - echo 'No error message!'; -} -?></p> -</body> -</html> diff --git a/lang/german-utf-8.inc.php b/lang/german-utf-8.inc.php index 52c7ff6..22de3a5 100644 --- a/lang/german-utf-8.inc.php +++ b/lang/german-utf-8.inc.php @@ -60,6 +60,7 @@ $strAllTableSameWidth = 'Sollen alle Tabellen mit der gleichen Breite angezeigt $strAlterOrderBy = 'Tabelle sortieren nach'; $strAnalyze = 'Analysieren'; $strAnalyzeTable = 'Analysiere Tabelle'; +$strAndSmall = 'und'; $strAndThen = 'und dann'; $strAnd = 'und'; $strAngularLinks = 'Winklige Verbindung'; @@ -413,6 +414,7 @@ $strImportNoticePt2 = 'Zum Anzeigen einer Struktur einfach auf den Namen klicken $strImportNoticePt3 = 'Zum Ändern der Einstellungen auf das entsprechende "Optionen" klicken'; $strImportNoticePt4 = 'Zum Ändern der Struktur auf das entsprechenden "Struktur" klicken'; $strImportODSCurrency = 'Währungen importieren ($5.00 zu 5.00)'; +$strImportODS = 'Öffne Dokument Tabelle'; $strImportODSPercents = 'Prozentwerte importieren (12.00% wird zu .12)'; $strImportProceedingFile = 'Bitte Geduld, die Datei wird abgearbeitet.'; $strImportSuccessfullyFinished = 'Der Import wurde erfolgreich abgeschlossen, %d Abfragen wurden ausgeführt.'; @@ -781,6 +783,8 @@ $strReplicationSelectDatabases = 'Bitte Datenbank auswählen'; $strReplicationServernConfiguredMaster = 'Dieser Server ist als nicht Master in einem Replikations-Prozess konfiguriert. Möchten Sie ihn <a href="%s">konfigurieren</a>?'; $strReplicationShowConnectedSlavesNote = 'Nur Slaves, die mit der Option --report-host=host_name gestartet wurden, sind in dieser Liste sichtbar'; $strReplicationShowConnectedSlaves = 'Zeige verbundene Slaves'; +$strReplicationShowMasterStatus = 'Zeige Haupt Status'; +$strReplicationSkippingErrorWarn = 'Errror überspringen kann dazu führen, dass die Master- und Slave Server nicht mehr abgeglichen sind!'; $strReplicationSlaveConfiguration = 'Slave-Konfiguration'; $strReplicationSlaveConfigured = 'Dieser Server ist als Slave in eienem Replikations Prozess konfiguriert. Möchten Sie:'; $strReplicationSlaveErrorManagement = 'Fehlerbehandlung:'; @@ -796,6 +800,7 @@ $strReplicationSlaveSkipNext = 'Überspringe nächsten'; $strReplicationSlave = 'Slave Replikation'; $strReplicationSlaveSQLThreadNotRunning = 'Slave SQL Thread läuft nicht!'; $strReplicationSlaveSQLThread = 'Nur SQL Thread %s'; +$strReplicationStatusInfo = 'Dieser MySQL Server arbeitet als ein %s in <b>Replication</b> Prozess. Für weitere Informationen über den Replication Status auf dem Server, besuche bitte die <a href="#replication">Replication Abteilung</a>.'; $strReplicationStatus_master = 'Master-Status'; $strReplicationStatus = 'Replikations-Status'; $strReplicationStatus_slave = 'Slave-Status'; @@ -1016,6 +1021,7 @@ $strSetupImport_allow_interrupt_desc = 'Unterbrechungen bei Import erlauben, fal $strSetupImport_allow_interrupt_name = 'Teilweiser Import: Unterbrechung erlauben'; $strSetupImport_format_desc = 'Voreingestelltes Format. Bitte beachten, dass diese Liste vom Ort abhängt (Datenbank, Tabelle) und nur SQL immer verfügbar ist'; $strSetupImport_format_name = 'Dateiformat'; +$strSetupImport_skip_queries_desc = 'Anzahl von Einträgen (Abfragen) zum überspringen vom Start'; $strSetupImport_skip_queries_name = 'Teilimport: Überspringe Anfragen'; $strSetupInsecureConnectionMsg1 = 'Sie benutzen keine sichere Verbindung. Alle Daten (einschließlich sensitiver Information wie Passwörter) werden unverschlüsselt übertragen!'; $strSetupInsecureConnectionMsg2 = 'Falls Ihr Server HTTPS Anfragen akzeptiert, folgen Sie [a@%s]diesem Link[/a] um eine sichere Verbindung zu benutzen.'; @@ -1064,6 +1070,7 @@ $strSetupMaxTableList_desc = 'Maximale Anzahl der in einer Tabellenliste angezei $strSetupMaxTableList_name = 'Tabellen Maximum'; $strSetupMemoryLimit_desc = 'Anzahl der Bytes, welche ein Script zur Ausführung benötigen darf, z.B. [kbd]32M[/kbd] ([kbd]0[/kbd] für unbegrenzt)'; $strSetupMemoryLimit_name = 'Speicher Limit'; +$strSetupNavigationBarIconic_desc = 'Benutze nur Icons, nur Text oder beides'; $strSetupNavigationBarIconic_name = 'Navigationsleiste mit Icons'; $strSetupNewServer = 'Neuer Server'; $strSetupNoServers = 'Es sind keine Server konfiguriert'; @@ -1135,7 +1142,9 @@ $strSetupServers_host_name = 'Hostname'; $strSetupServers_LogoutURL_name = 'Logout URL'; $strSetupServers_nopassword_desc = 'Versuche ohne Passwort zu verbinden'; $strSetupServers_nopassword_name = 'Ohne Passwort verbinden'; +$strSetupServers_only_db_desc = 'Du kannst MySQL Platzhalter Symbole (% und _) benutzen, entferne sie falls du wörtliche Instanzen benutzen möchtest, z.B. nutze 'my_db' und nicht 'my_db''; $strSetupServers_only_db_name = 'Nur aufgelistete Datenbanken zeigen'; +$strSetupServers_password_desc = 'Lass dies leer falls nicht, benutze config auth'; $strSetupServers_password_name = 'Passwort für config Authentifikation'; $strSetupServers_pdf_pages_desc = 'Leer lassen für keine PDF Schema Unterstützung, Vorschlag: [kbd]pma_pdf_pages[/kbd]'; $strSetupServers_pdf_pages_name = 'PDF Pages Table'; @@ -1193,6 +1202,7 @@ $strSetupSQLQuery_Edit_name = 'Bearbeiten'; $strSetupSQLQuery_Explain_name = 'SQL erklären'; $strSetupSQLQuery_Refresh_name = 'Aktualisieren'; $strSetupSQLQuery_ShowAsPHP_name = 'PHP-Code erzeugen'; +$strSetupSQLQuery_Validate_name = 'Validiere SQL'; $strSetupSuggestDBName_desc = 'Schlage (wenn möglich) einen Datenbank-Namen im "Create Database" Formular vor oder lasse das Textfeld leer'; $strSetupSuggestDBName_name = 'Schlage einen neuen Datenbank-Namen vor'; $strSetupTrue = 'Ja'; @@ -1392,6 +1402,7 @@ $strStrucData = 'Struktur und Daten'; $strStrucExcelCSV = 'CSV-Daten für MS Excel'; $strStrucOnly = 'Nur Struktur'; $strStructPropose = 'Tabellenstruktur analysieren'; +$strStructureDiff = 'Struktur Unterschiede' ; $strStructureForView = 'Struktur des Views'; $strStructureLC = 'Struktur'; $strStructure = 'Struktur'; @@ -1415,6 +1426,7 @@ $strTableAddColumn = 'Spalte(n) einfügen'; $strTableAlreadyExists = 'Die Tabelle %s existiert bereits!'; $strTableAlterColumn = 'Spalte(n) ändern'; $strTableAlteredSuccessfully = 'Die Tabelle %1$s wurde erfolgreich geändert'; +$strTableAlterIndex = 'Ändere index(e)'; $strTableApplyIndex = 'Index/Indices anwenden'; $strTableComments = 'Tabellen-Kommentar'; $strTableDeleteRows = 'Möchten Sie alle vorhergehenden zeilen aus den Ziel-Tabellen löschen?'; @@ -1609,22 +1621,4 @@ $strYes = 'Ja'; $strZeroRemovesTheLimit = 'Der Wert 0 (null) entfernt die Beschränkung.'; $strZip = 'Zip-komprimiert';
-// To translate: -$strAndSmall = 'and'; //to translate - -$strImportODS = 'Open Document Spreadsheet'; //to translate - -$strReplicationShowMasterStatus = 'Show master status'; //to translate -$strReplicationSkippingErrorWarn = 'Skipping error(s) might lead into unsynchronized master and slave!'; //to translate -$strReplicationStatusInfo = 'This MySQL server works as %s in <b>replication</b> process. For further information about replication status on the server, please visit the <a href="#replication">replication section</a>.'; //to translate - -$strSetupImport_skip_queries_desc = 'Number of records (queries) to skip from start'; //to translate -$strSetupNavigationBarIconic_desc = 'Use only icons, only text or both'; //to translate -$strSetupServers_only_db_desc = 'You can use MySQL wildcard characters (% and _), escape them if you want to use their literal instances, i.e. use 'my_db' and not 'my_db''; //to translate -$strSetupServers_password_desc = 'Leave empty if not using config auth'; //to translate -$strSetupSQLQuery_Validate_name = 'Validate SQL'; //to translate -$strStructureDiff = 'Structure Difference' ; //to translate - -$strTableAlterIndex = 'Alter index(s)'; //to translate - ?> diff --git a/libraries/Config.class.php b/libraries/Config.class.php index e0f9523..1a5521d 100644 --- a/libraries/Config.class.php +++ b/libraries/Config.class.php @@ -92,7 +92,7 @@ class PMA_Config */ function checkSystem() { - $this->set('PMA_VERSION', '3.3.9.2'); + $this->set('PMA_VERSION', '3.3.10'); /** * @deprecated */ diff --git a/libraries/common.inc.php b/libraries/common.inc.php index 86416a5..dd51900 100644 --- a/libraries/common.inc.php +++ b/libraries/common.inc.php @@ -325,7 +325,6 @@ $goto_whitelist = array( 'db_printview.php', 'db_search.php', //'Documentation.html', - //'error.php', 'export.php', 'import.php', //'index.php', diff --git a/libraries/core.lib.php b/libraries/core.lib.php index f7f9da4..fa4f007 100644 --- a/libraries/core.lib.php +++ b/libraries/core.lib.php @@ -261,21 +261,18 @@ function PMA_fatalError($error_message, $message_args = null) $error_message = strtr($error_message, array('<br />' => '[br]'));
// Displays the error message - // (do not use & for parameters sent by header) - $query_params = array( - 'lang' => $GLOBALS['available_languages'][$GLOBALS['lang']][2], - 'dir' => $GLOBALS['text_dir'], - 'type' => $GLOBALS['strError'], - 'error' => $error_message, - ); - header('Location: ' . (defined('PMA_SETUP') ? '../' : '') . 'error.php?' - . http_build_query($query_params, null, '&')); + $lang = $GLOBALS['available_languages'][$GLOBALS['lang']][2]; + $dir = $GLOBALS['text_dir']; + $type = $GLOBALS['strError']; + $error = $error_message;
// on fatal errors it cannot hurt to always delete the current session if (isset($GLOBALS['session_name']) && isset($_COOKIE[$GLOBALS['session_name']])) { PMA_removeCookie($GLOBALS['session_name']); }
+ require('./libraries/error.inc.php'); + exit; }
diff --git a/libraries/database_interface.lib.php b/libraries/database_interface.lib.php index 300a925..6c321b1 100644 --- a/libraries/database_interface.lib.php +++ b/libraries/database_interface.lib.php @@ -79,8 +79,8 @@ require_once './libraries/dbi/' . $GLOBALS['cfg']['Server']['extension'] . '.dbi /** * Common Functions */ -function PMA_DBI_query($query, $link = null, $options = 0) { - $res = PMA_DBI_try_query($query, $link, $options) +function PMA_DBI_query($query, $link = null, $options = 0, $cache_affected_rows = true) { + $res = PMA_DBI_try_query($query, $link, $options, $cache_affected_rows) or PMA_mysqlDie(PMA_DBI_getError($link), $query); return $res; } @@ -367,8 +367,16 @@ function PMA_DBI_get_tables_full($database, $table = false, $tbl_is_group = fals } else { // Prepare to sort by creating array of the selected sort // value to pass to array_multisort - foreach ($each_tables as $table_name => $table_data) { - ${$sort_by}[$table_name] = strtolower($table_data[$sort_by]); + + // Size = Data_length + Index_length + if ($sort_by == 'Data_length') { + foreach ($each_tables as $table_name => $table_data) { + ${$sort_by}[$table_name] = strtolower($table_data['Data_length'] + $table_data['Index_length']); + } + } else { + foreach ($each_tables as $table_name => $table_data) { + ${$sort_by}[$table_name] = strtolower($table_data[$sort_by]); + } }
if ($sort_order == 'DESC') { diff --git a/libraries/dbi/mysql.dbi.lib.php b/libraries/dbi/mysql.dbi.lib.php index bf16114..5d2f8fe 100644 --- a/libraries/dbi/mysql.dbi.lib.php +++ b/libraries/dbi/mysql.dbi.lib.php @@ -155,7 +155,7 @@ function PMA_DBI_select_db($dbname, $link = null) * @param integer $options * @return mixed */ -function PMA_DBI_try_query($query, $link = null, $options = 0) +function PMA_DBI_try_query($query, $link = null, $options = 0, $cache_affected_rows = true) { if (empty($link)) { if (isset($GLOBALS['userlink'])) { @@ -176,6 +176,10 @@ function PMA_DBI_try_query($query, $link = null, $options = 0) $r = mysql_query($query, $link); }
+ if ($cache_affected_rows) { + $GLOBALS['cached_affected_rows'] = PMA_DBI_affected_rows($link, $get_from_cache = false); + } + if ($GLOBALS['cfg']['DBG']['sql']) { $time = microtime(true) - $time;
@@ -392,17 +396,24 @@ function PMA_DBI_insert_id($link = null) return false; } } - //$insert_id = mysql_insert_id($link); - // if the primary key is BIGINT we get an incorrect result + // If the primary key is BIGINT we get an incorrect result // (sometimes negative, sometimes positive) // and in the present function we don't know if the PK is BIGINT // so better play safe and use LAST_INSERT_ID() // - // by the way, no problem with mysqli_insert_id() return PMA_DBI_fetch_value('SELECT LAST_INSERT_ID();', 0, 0, $link); }
-function PMA_DBI_affected_rows($link = null) +/** + * returns the number of rows affected by last query + * + * @uses $GLOBALS['userlink'] + * @uses mysql_affected_rows() + * @param object mysql $link the mysql object + * @param boolean $get_from_cache + * @return string integer + */ +function PMA_DBI_affected_rows($link = null, $get_from_cache = true) { if (empty($link)) { if (isset($GLOBALS['userlink'])) { @@ -411,7 +422,12 @@ function PMA_DBI_affected_rows($link = null) return false; } } - return mysql_affected_rows($link); + + if ($get_from_cache) { + return $GLOBALS['cached_affected_rows']; + } else { + return mysql_affected_rows($link); + } }
/** diff --git a/libraries/dbi/mysqli.dbi.lib.php b/libraries/dbi/mysqli.dbi.lib.php index b064953..07de2f7 100644 --- a/libraries/dbi/mysqli.dbi.lib.php +++ b/libraries/dbi/mysqli.dbi.lib.php @@ -175,9 +175,10 @@ function PMA_DBI_select_db($dbname, $link = null) * @param string $query query to execute * @param object mysqli $link mysqli object * @param integer $options + * @param boolean $cache_affected_rows * @return mixed true, false or result object */ -function PMA_DBI_try_query($query, $link = null, $options = 0) +function PMA_DBI_try_query($query, $link = null, $options = 0, $cache_affected_rows = true) { if ($options == ($options | PMA_DBI_QUERY_STORE)) { $method = MYSQLI_STORE_RESULT; @@ -199,6 +200,11 @@ function PMA_DBI_try_query($query, $link = null, $options = 0) $time = microtime(true); } $r = mysqli_query($link, $query, $method); + + if ($cache_affected_rows) { + $GLOBALS['cached_affected_rows'] = PMA_DBI_affected_rows($link, $get_from_cache = false); + } + if ($GLOBALS['cfg']['DBG']['sql']) { $time = microtime(true) - $time;
@@ -451,7 +457,13 @@ function PMA_DBI_insert_id($link = '') return false; } } - return mysqli_insert_id($link); + // When no controluser is defined, using mysqli_insert_id($link) + // does not always return the last insert id due to a mixup with + // the tracking mechanism, but this works: + return PMA_DBI_fetch_value('SELECT LAST_INSERT_ID();', 0, 0, $link); + // Curiously, this problem does not happen with the mysql extension but + // there is another problem with BIGINT primary keys so PMA_DBI_insert_id() + // in the mysql extension also uses this logic. }
/** @@ -460,9 +472,10 @@ function PMA_DBI_insert_id($link = '') * @uses $GLOBALS['userlink'] * @uses mysqli_affected_rows() * @param object mysqli $link the mysqli object + * @param boolean $get_from_cache * @return string integer */ -function PMA_DBI_affected_rows($link = null) +function PMA_DBI_affected_rows($link = null, $get_from_cache = true) { if (empty($link)) { if (isset($GLOBALS['userlink'])) { @@ -471,7 +484,11 @@ function PMA_DBI_affected_rows($link = null) return false; } } - return mysqli_affected_rows($link); + if ($get_from_cache) { + return $GLOBALS['cached_affected_rows']; + } else { + return mysqli_affected_rows($link); + } }
/** diff --git a/libraries/error.inc.php b/libraries/error.inc.php new file mode 100644 index 0000000..95d8847 --- /dev/null +++ b/libraries/error.inc.php @@ -0,0 +1,57 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * phpMyAdmin fatal error display page + * + * @package phpMyAdmin + */ + +if (! defined('PHPMYADMIN')) { + exit; +} + +header('Content-Type: text/html; charset=utf-8'); +?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $lang; ?>" dir="<?php echo $dir; ?>"> +<head> + <link rel="icon" href="./favicon.ico" type="image/x-icon" /> + <link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" /> + <title>phpMyAdmin</title> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <style type="text/css"> + <!-- + html { + padding: 0; + margin: 0; + } + body { + font-family: sans-serif; + font-size: small; + color: #000000; + background-color: #F5F5F5; + margin: 1em; + } + h1 { + margin: 0; + padding: 0.3em; + font-size: 1.4em; + font-weight: bold; + color: #ffffff; + background-color: #ff0000; + } + p { + margin: 0; + padding: 0.5em; + border: 0.1em solid red; + background-color: #ffeeee; + } + //--> + </style> +</head> +<body> +<h1>phpMyAdmin - <?php echo $error_header; ?></h1> +<p><?php echo PMA_sanitize($error_message); ?></p> +</body> +</html> + diff --git a/libraries/export/yaml.php b/libraries/export/yaml.php index d1ba38e..946962c 100644 --- a/libraries/export/yaml.php +++ b/libraries/export/yaml.php @@ -167,11 +167,8 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) continue; }
- $record[$i] = preg_replace('/\r\n|\r|\n/', $crlf.' ', $record[$i]); - if (strstr($record[$i], $crlf)) - $record[$i] = '|-' . $crlf . ' '.$record[$i]; - - $buffer .= ' ' . $column . ': ' . $record[$i] . $crlf; + $record[$i] = str_replace(array('\', '"', "\n", "\r"), array('\\', '"', '\n', '\r'), $record[$i]); + $buffer .= ' ' . $column . ': "' . $record[$i] . '"' . $crlf; }
if (! PMA_exportOutputHandler($buffer)) { diff --git a/libraries/relation.lib.php b/libraries/relation.lib.php index 6b1ac67..b98fb6a 100644 --- a/libraries/relation.lib.php +++ b/libraries/relation.lib.php @@ -29,10 +29,16 @@ require_once './libraries/Table.class.php'; */ function PMA_query_as_controluser($sql, $show_error = true, $options = 0) { + // Avoid caching of the number of rows affected; for example, this function + // is called for tracking purposes but we want to display the correct number + // of rows affected by the original query, not by the query generated for + // tracking. + $cache_affected_rows = false; + if ($show_error) { - $result = PMA_DBI_query($sql, $GLOBALS['controllink'], $options); + $result = PMA_DBI_query($sql, $GLOBALS['controllink'], $options, $cache_affected_rows); } else { - $result = @PMA_DBI_try_query($sql, $GLOBALS['controllink'], $options); + $result = @PMA_DBI_try_query($sql, $GLOBALS['controllink'], $options, $cache_affected_rows); } // end if... else...
if ($result) { diff --git a/phpinfo.php b/phpinfo.php index 043db95..15f1818 100644 --- a/phpinfo.php +++ b/phpinfo.php @@ -7,10 +7,6 @@ */
/** - * @ignore - */ -define('PMA_MINIMUM_COMMON', true); -/** * Gets core libraries and defines some variables */ require_once './libraries/common.inc.php'; diff --git a/tbl_replace.php b/tbl_replace.php index a7da0bc..36e5d74 100644 --- a/tbl_replace.php +++ b/tbl_replace.php @@ -357,7 +357,7 @@ foreach ($query as $single_query) { if (! $result) { $error_messages[] = PMA_DBI_getError(); } else { - // the following is a real assignment: + // The next line contains a real assignment, it's not a typo if ($tmp = @PMA_DBI_affected_rows()) { $total_affected_rows += $tmp; } diff --git a/themes/.gitignore b/themes/.gitignore index 410d2dc..5bae234 100644 --- a/themes/.gitignore +++ b/themes/.gitignore @@ -16,6 +16,7 @@ original_small paradice pixeline pmahomme +programmersdarkside silk silkline smooth_yellow diff --git a/translators.html b/translators.html index ff9bd4f..5882a08 100644 --- a/translators.html +++ b/translators.html @@ -11,7 +11,7 @@ <link rel="icon" href="./favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <title>phpMyAdmin 3.3.9.2 - Official translators</title> + <title>phpMyAdmin 3.3.10 - Official translators</title> <link rel="stylesheet" type="text/css" href="docs.css" /> </head>
@@ -19,7 +19,7 @@ <div id="header"> <h1> <a href="http://www.phpmyadmin.net/">php<span class="myadmin">MyAdmin</span></a> - 3.3.9.2 + 3.3.10 official translators list </h1> </div>
hooks/post-receive