From e637c57c42176087c79e9f928746823bb4d3ce7f Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Wed, 15 Apr 2015 10:06:48 -0400 Subject: [PATCH 1/9] Bug PHP 7 compatibility in php-gettext Signed-off-by: Marc Delisle --- ChangeLog | 1 + libraries/php-gettext/gettext.php | 2 +- libraries/php-gettext/streams.php | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 48ffd13132..22e8ba1fa0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,7 @@ phpMyAdmin - ChangeLog - bug #4794 Server error viewing table content - bug Fix issues related to number of decimal places in time - bug #4853 Relation view between 1600 and 1780 px +- bug PHP 7 compatibility in php-gettext 4.4.2.0 (2015-04-13) - bug #4835 PMA_hideShowConnection not called after submit_num_fields diff --git a/libraries/php-gettext/gettext.php b/libraries/php-gettext/gettext.php index 5064047cbd..3486e92f07 100644 --- a/libraries/php-gettext/gettext.php +++ b/libraries/php-gettext/gettext.php @@ -98,7 +98,7 @@ class gettext_reader { * @param object Reader the StreamReader object * @param boolean enable_cache Enable or disable caching of strings (default on) */ - function gettext_reader($Reader, $enable_cache = true) { + public function __construct($Reader, $enable_cache = true) { // If there isn't a StreamReader, turn on short circuit mode. if (! $Reader || isset($Reader->error) ) { $this->short_circuit = true; diff --git a/libraries/php-gettext/streams.php b/libraries/php-gettext/streams.php index 3cdc1584e1..ab947194a2 100644 --- a/libraries/php-gettext/streams.php +++ b/libraries/php-gettext/streams.php @@ -49,7 +49,7 @@ class StringReader { var $_pos; var $_str; - function StringReader($str='') { + public function __construct($str='') { $this->_str = $str; $this->_pos = 0; } @@ -86,7 +86,7 @@ class FileReader { var $_fd; var $_length; - function FileReader($filename) { + public function __construct($filename) { if (file_exists($filename)) { $this->_length=filesize($filename); @@ -143,7 +143,7 @@ class FileReader { // Preloads entire file in memory first, then creates a StringReader // over it (it assumes knowledge of StringReader internals) class CachedFileReader extends StringReader { - function CachedFileReader($filename) { + public function __construct($filename) { if (file_exists($filename)) { $length=filesize($filename); From c8b943b556e6fe7a3e82cae18234267b36271e2a Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Wed, 15 Apr 2015 10:18:49 -0400 Subject: [PATCH 2/9] Revert "Bug PHP 7 compatibility in php-gettext" This reverts commit e637c57c42176087c79e9f928746823bb4d3ce7f. Signed-off-by: Marc Delisle --- ChangeLog | 1 - libraries/php-gettext/gettext.php | 2 +- libraries/php-gettext/streams.php | 6 +++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 22e8ba1fa0..48ffd13132 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,7 +8,6 @@ phpMyAdmin - ChangeLog - bug #4794 Server error viewing table content - bug Fix issues related to number of decimal places in time - bug #4853 Relation view between 1600 and 1780 px -- bug PHP 7 compatibility in php-gettext 4.4.2.0 (2015-04-13) - bug #4835 PMA_hideShowConnection not called after submit_num_fields diff --git a/libraries/php-gettext/gettext.php b/libraries/php-gettext/gettext.php index 3486e92f07..5064047cbd 100644 --- a/libraries/php-gettext/gettext.php +++ b/libraries/php-gettext/gettext.php @@ -98,7 +98,7 @@ class gettext_reader { * @param object Reader the StreamReader object * @param boolean enable_cache Enable or disable caching of strings (default on) */ - public function __construct($Reader, $enable_cache = true) { + function gettext_reader($Reader, $enable_cache = true) { // If there isn't a StreamReader, turn on short circuit mode. if (! $Reader || isset($Reader->error) ) { $this->short_circuit = true; diff --git a/libraries/php-gettext/streams.php b/libraries/php-gettext/streams.php index ab947194a2..3cdc1584e1 100644 --- a/libraries/php-gettext/streams.php +++ b/libraries/php-gettext/streams.php @@ -49,7 +49,7 @@ class StringReader { var $_pos; var $_str; - public function __construct($str='') { + function StringReader($str='') { $this->_str = $str; $this->_pos = 0; } @@ -86,7 +86,7 @@ class FileReader { var $_fd; var $_length; - public function __construct($filename) { + function FileReader($filename) { if (file_exists($filename)) { $this->_length=filesize($filename); @@ -143,7 +143,7 @@ class FileReader { // Preloads entire file in memory first, then creates a StringReader // over it (it assumes knowledge of StringReader internals) class CachedFileReader extends StringReader { - public function __construct($filename) { + function CachedFileReader($filename) { if (file_exists($filename)) { $length=filesize($filename); From 77369e5e2b56636fe4c14a6b78cc3b170cfccc03 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Wed, 15 Apr 2015 11:32:31 -0400 Subject: [PATCH 3/9] Bug PHP 7 compatibility in php-gettext Signed-off-by: Marc Delisle --- ChangeLog | 1 + libraries/php-gettext/gettext.php | 2 +- libraries/php-gettext/streams.php | 6 +++--- test/libraries/php-gettext/PMA_FileReader_test.php | 8 +++++--- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 48ffd13132..22e8ba1fa0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,7 @@ phpMyAdmin - ChangeLog - bug #4794 Server error viewing table content - bug Fix issues related to number of decimal places in time - bug #4853 Relation view between 1600 and 1780 px +- bug PHP 7 compatibility in php-gettext 4.4.2.0 (2015-04-13) - bug #4835 PMA_hideShowConnection not called after submit_num_fields diff --git a/libraries/php-gettext/gettext.php b/libraries/php-gettext/gettext.php index 5064047cbd..3486e92f07 100644 --- a/libraries/php-gettext/gettext.php +++ b/libraries/php-gettext/gettext.php @@ -98,7 +98,7 @@ class gettext_reader { * @param object Reader the StreamReader object * @param boolean enable_cache Enable or disable caching of strings (default on) */ - function gettext_reader($Reader, $enable_cache = true) { + public function __construct($Reader, $enable_cache = true) { // If there isn't a StreamReader, turn on short circuit mode. if (! $Reader || isset($Reader->error) ) { $this->short_circuit = true; diff --git a/libraries/php-gettext/streams.php b/libraries/php-gettext/streams.php index 3cdc1584e1..ab947194a2 100644 --- a/libraries/php-gettext/streams.php +++ b/libraries/php-gettext/streams.php @@ -49,7 +49,7 @@ class StringReader { var $_pos; var $_str; - function StringReader($str='') { + public function __construct($str='') { $this->_str = $str; $this->_pos = 0; } @@ -86,7 +86,7 @@ class FileReader { var $_fd; var $_length; - function FileReader($filename) { + public function __construct($filename) { if (file_exists($filename)) { $this->_length=filesize($filename); @@ -143,7 +143,7 @@ class FileReader { // Preloads entire file in memory first, then creates a StringReader // over it (it assumes knowledge of StringReader internals) class CachedFileReader extends StringReader { - function CachedFileReader($filename) { + public function __construct($filename) { if (file_exists($filename)) { $length=filesize($filename); diff --git a/test/libraries/php-gettext/PMA_FileReader_test.php b/test/libraries/php-gettext/PMA_FileReader_test.php index df48e31174..c083d3ab9d 100644 --- a/test/libraries/php-gettext/PMA_FileReader_test.php +++ b/test/libraries/php-gettext/PMA_FileReader_test.php @@ -121,8 +121,10 @@ class PMA_FileReader_Test extends PHPUnit_Framework_TestCase public function testForNonExistingFile() { $file = new FileReader('./path/for/no/file.txt'); + // looking at the return value of a constructor is curious + // but the constructor returns a value $this->assertFalse( - $file->FileReader('./path/for/no/file.txt') + $file->__construct('./path/for/no/file.txt') ); } @@ -130,11 +132,11 @@ class PMA_FileReader_Test extends PHPUnit_Framework_TestCase { $reader = new CachedFileReader('./test/test_data/test.file'); $this->assertEquals( - $reader->CachedFileReader('./test/test_data/test.file'), + $reader->__construct('./test/test_data/test.file'), null ); $this->assertFalse( - $reader->CachedFileReader('./path/for/no/file.txt') + $reader->__construct('./path/for/no/file.txt') ); } From 011438e74a11d3b1b820c077fa44907f389cd9af Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Wed, 15 Apr 2015 12:56:56 -0400 Subject: [PATCH 4/9] Bug PHP 7 compatibility in bfShapeFiles Signed-off-by: Marc Delisle --- ChangeLog | 1 + libraries/bfShapeFiles/ShapeFile.lib.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 22e8ba1fa0..63fb3110aa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,7 @@ phpMyAdmin - ChangeLog - bug Fix issues related to number of decimal places in time - bug #4853 Relation view between 1600 and 1780 px - bug PHP 7 compatibility in php-gettext +- bug PHP 7 compatibility in bfShapeFiles 4.4.2.0 (2015-04-13) - bug #4835 PMA_hideShowConnection not called after submit_num_fields diff --git a/libraries/bfShapeFiles/ShapeFile.lib.php b/libraries/bfShapeFiles/ShapeFile.lib.php index bf726a328c..795d0aa292 100644 --- a/libraries/bfShapeFiles/ShapeFile.lib.php +++ b/libraries/bfShapeFiles/ShapeFile.lib.php @@ -83,7 +83,7 @@ var $records; - function ShapeFile($shapeType, $boundingBox = array("xmin" => 0.0, "ymin" => 0.0, "xmax" => 0.0, "ymax" => 0.0), $FileName = NULL) { + public function __construct($shapeType, $boundingBox = array("xmin" => 0.0, "ymin" => 0.0, "xmax" => 0.0, "ymax" => 0.0), $FileName = NULL) { $this->shapeType = $shapeType; $this->boundingBox = $boundingBox; $this->FileName = $FileName; @@ -357,7 +357,7 @@ var $SHPData = array(); var $DBFData = array(); - function ShapeRecord($shapeType) { + public function __construct($shapeType) { $this->shapeType = $shapeType; } From f8973cbe63adc9bc9f01f31dc0ebadc4e4bec957 Mon Sep 17 00:00:00 2001 From: Stefano Martinelli Date: Wed, 15 Apr 2015 23:57:23 +0200 Subject: [PATCH 5/9] Translated using Weblate (Italian) Currently translated at 100.0% (3075 of 3075 strings) [CI skip] --- po/it.po | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/po/it.po b/po/it.po index 0c33b95b87..eea33cb29f 100644 --- a/po/it.po +++ b/po/it.po @@ -4,7 +4,7 @@ msgstr "" "Project-Id-Version: phpMyAdmin 4.5.0-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2015-04-10 10:21-0400\n" -"PO-Revision-Date: 2015-04-15 09:43+0200\n" +"PO-Revision-Date: 2015-04-15 23:57+0200\n" "Last-Translator: Stefano Martinelli \n" "Language-Team: Italian " "\n" @@ -5908,12 +5908,11 @@ msgid "Export views as tables" msgstr "Esporta le viste come tabelle" #: libraries/config/messages.inc.php:176 -#, fuzzy #| msgid "%sCreate%s missing phpMyAdmin configuration storage tables." msgid "Export related metadata from phpMyAdmin configuration storage" msgstr "" -"%sCreate%s mancano le tabelle di salvataggio della configurazione di " -"phpMyAdmin." +"Esporta i metadati correlati prelevandoli dall'area di configurazione di " +"phpMyAdmin" #: libraries/config/messages.inc.php:177 libraries/config/messages.inc.php:179 #: libraries/config/messages.inc.php:180 libraries/config/messages.inc.php:181 @@ -7588,12 +7587,13 @@ msgid "Skip locked tables" msgstr "Ignora le tabelle bloccate" #: libraries/config/messages.inc.php:773 -#, fuzzy #| msgid "A warning is displayed on the main page if Suhosin is detected." msgid "" "Disable the default warning that is displayed on the main page if Suhosin is " "detected." -msgstr "Mostra un avviso sulla pagina principale se viene rilevato Suhosin." +msgstr "" +"Disabilita l'avviso predefinito che è visualizzato sulla pagina principale " +"se viene rilevato Suhosin." #: libraries/config/messages.inc.php:774 msgid "Suhosin warning" @@ -8034,7 +8034,7 @@ msgstr "Numero di tabelle:" #: libraries/db_designer.lib.php:591 msgid "Toggle" -msgstr "" +msgstr "Scambia" #: libraries/db_designer.lib.php:614 msgid "See table structure" @@ -10141,6 +10141,8 @@ msgstr "Struttura stand-in per le viste" #: libraries/plugins/export/ExportJson.class.php:70 msgid "Output pretty-printed JSON (Use human-readable formatting)" msgstr "" +"Output JSON ben formattato per la stampa (Utilizza una formattazione per la " +"lettura facilitata)" #: libraries/plugins/export/ExportLatex.class.php:43 msgid "Content of table @TABLE@" @@ -10279,10 +10281,9 @@ msgstr "" "del database" #: libraries/plugins/export/ExportSql.class.php:161 -#, fuzzy #| msgid "Export method" msgid "Export metadata" -msgstr "Metodo di esportazione" +msgstr "Esporta i metadati" #: libraries/plugins/export/ExportSql.class.php:176 msgid "" @@ -10415,10 +10416,10 @@ msgid "It appears your database uses functions;" msgstr "Il tuo database sembra utilizzare le funzioni;" #: libraries/plugins/export/ExportSql.class.php:989 -#, fuzzy, php-format +#, php-format #| msgid "Metadata Headers" msgid "Metadata for %s" -msgstr "Intestazioni di Metadata" +msgstr "Metadati per %s" #: libraries/plugins/export/ExportSql.class.php:1352 msgid "It appears your database uses views;" @@ -10483,7 +10484,7 @@ msgstr "Tabella:" #: libraries/plugins/export/PMA_ExportPdf.class.php:118 msgid "Purpose:" -msgstr "" +msgstr "Scopo:" #: libraries/plugins/export/PMA_ExportPdf.class.php:494 msgid "MIME" @@ -11085,6 +11086,10 @@ msgid "" "'phpmyadmin'. You may go to 'Operations' tab of any database to set up the " "phpMyAdmin configuration storage there." msgstr "" +"Non possiedi i privilegi necessari per creare un database di nome " +"'phpmyadmin'. Puoi andare nella sezione 'Operazioni' di un qualunque " +"database per impostare in quel database la memorizzazione della " +"configurazione di phpMyAdmin." #: libraries/relation.lib.php:2005 #, php-format @@ -12172,7 +12177,7 @@ msgstr "" #: libraries/server_privileges.lib.php:818 msgid "Requires a valid X509 certificate." -msgstr "" +msgstr "Richiede un certificato X509 valido." #: libraries/server_privileges.lib.php:867 msgid "Resource limits" From 95868e896e815d71e6326ce484472bc8ac047d7d Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Thu, 16 Apr 2015 09:00:28 -0400 Subject: [PATCH 6/9] Bug PHP 7 session_regenerate_id() warning Signed-off-by: Marc Delisle --- ChangeLog | 1 + libraries/session.inc.php | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 63fb3110aa..3539d9892d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,7 @@ phpMyAdmin - ChangeLog - bug #4853 Relation view between 1600 and 1780 px - bug PHP 7 compatibility in php-gettext - bug PHP 7 compatibility in bfShapeFiles +- bug PHP 7 session_regenerate_id() warning 4.4.2.0 (2015-04-13) - bug #4835 PMA_hideShowConnection not called after submit_num_fields diff --git a/libraries/session.inc.php b/libraries/session.inc.php index a0b58a532f..22185acb5e 100644 --- a/libraries/session.inc.php +++ b/libraries/session.inc.php @@ -119,7 +119,12 @@ if (! isset($_SESSION[' PMA_token '])) { function PMA_secureSession() { // prevent session fixation and XSS - session_regenerate_id(true); + // (better to use session_status() if available) + if ((PMA_PHP_INT_VERSION >= 50400 && session_status() === PHP_SESSION_ACTIVE) + || (PMA_PHP_INT_VERSION < 50400 && session_id() !== '') + ) { + session_regenerate_id(true); + } $_SESSION[' PMA_token '] = md5(uniqid(rand(), true)); } ?> From 7002b67b6ac027a2ee5634ae4dece14929ded6f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 15 Apr 2015 22:05:13 +0200 Subject: [PATCH 7/9] Translated using Weblate (Frisian) Currently translated at 20.8% (641 of 3075 strings) [CI skip] --- po/fy.po | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/po/fy.po b/po/fy.po index 396d70649d..e7f5b265f6 100644 --- a/po/fy.po +++ b/po/fy.po @@ -8,16 +8,16 @@ msgstr "" "Project-Id-Version: phpMyAdmin 4.5.0-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2015-04-10 10:21-0400\n" -"PO-Revision-Date: 2014-12-31 22:40+0200\n" -"Last-Translator: Robin van der Vliet \n" -"Language-Team: Frisian \n" +"PO-Revision-Date: 2015-04-15 22:05+0200\n" +"Last-Translator: Michal Čihař \n" +"Language-Team: Frisian " +"\n" +"Language: fy\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: fy\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 2.2-dev\n" +"X-Generator: Weblate 2.3-dev\n" #: changelog.php:36 license.php:28 #, php-format @@ -9757,10 +9757,9 @@ msgid "Purpose:" msgstr "" #: libraries/plugins/export/PMA_ExportPdf.class.php:494 -#, fuzzy #| msgid "MIME type" msgid "MIME" -msgstr "MIME-type" +msgstr "MIME" #: libraries/plugins/import/ImportCsv.class.php:63 #: libraries/plugins/import/ImportOds.class.php:75 From ce5f69c34fabe003e67d4699baab582298ace9fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 15 Apr 2015 22:05:06 +0200 Subject: [PATCH 8/9] Translated using Weblate (Spanish) Currently translated at 97.4% (2996 of 3075 strings) [CI skip] --- po/es.po | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/po/es.po b/po/es.po index 70928b96ad..6cb816cd56 100644 --- a/po/es.po +++ b/po/es.po @@ -4,14 +4,14 @@ msgstr "" "Project-Id-Version: phpMyAdmin 4.5.0-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2015-04-10 10:21-0400\n" -"PO-Revision-Date: 2015-03-05 21:07+0200\n" -"Last-Translator: Macofe \n" -"Language-Team: Spanish \n" +"PO-Revision-Date: 2015-04-15 22:05+0200\n" +"Last-Translator: Michal Čihař \n" +"Language-Team: Spanish " +"\n" +"Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: es\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" "X-Generator: Weblate 2.3-dev\n" @@ -10608,10 +10608,9 @@ msgid "Purpose:" msgstr "" #: libraries/plugins/export/PMA_ExportPdf.class.php:494 -#, fuzzy #| msgid "MIME type" msgid "MIME" -msgstr "MIME-type" +msgstr "MIME" #: libraries/plugins/import/ImportCsv.class.php:63 #: libraries/plugins/import/ImportOds.class.php:75 From e579ed12200fc9b75fac3eb4ec8a86a1609067e2 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Thu, 16 Apr 2015 14:20:40 -0400 Subject: [PATCH 9/9] Use the dot notation Signed-off-by: Marc Delisle --- js/functions.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/functions.js b/js/functions.js index 4ab67448bd..4c2cee3613 100644 --- a/js/functions.js +++ b/js/functions.js @@ -3848,8 +3848,8 @@ AJAX.registerOnload('functions.js', function () { cache: false, type: 'POST', data: { - favorite_tables: (isStorageSupported('localStorage') && typeof window.localStorage['favorite_tables'] !== 'undefined') - ? window.localStorage['favorite_tables'] + favorite_tables: (isStorageSupported('localStorage') && typeof window.localStorage.favorite_tables !== 'undefined') + ? window.localStorage.favorite_tables : '' }, success: function (data) {