From 81bdcec2acbc491778be4ab7aa17392e079b4197 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Thu, 7 Feb 2013 12:11:07 +0100 Subject: [PATCH 1/2] This variable might be unset --- export.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/export.php b/export.php index 512391d2e4..429bc1db32 100644 --- a/export.php +++ b/export.php @@ -658,7 +658,7 @@ do { } // We export just one table // $allrows comes from the form when "Dump all rows" has been selected - if ($allrows == '0' && $limit_to > 0 && $limit_from >= 0) { + if (isset($allrows) && $allrows == '0' && $limit_to > 0 && $limit_from >= 0) { $add_query = ' LIMIT ' . (($limit_from > 0) ? $limit_from . ', ' : '') . $limit_to; @@ -767,7 +767,7 @@ if (! empty($asfile)) { } } elseif ($compression == 'gzip') { // 3. as a gzipped file - if (@function_exists('gzencode') + if (@function_exists('gzencode') && ! @ini_get('zlib.output_compression') // Here, we detect Apache's mod_deflate so we bet that // this module is active for this instance of phpMyAdmin From b3a317da780df36ad595f4293e4d7e5150228259 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Thu, 7 Feb 2013 12:16:13 +0100 Subject: [PATCH 2/2] bug #3519 [export] Prevent infinite recursion in PDF export. --- ChangeLog | 1 + libraries/plugins/export/PMA_ExportPdf.class.php | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index 1618964a60..1fab40bbf8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -88,6 +88,7 @@ VerboseMultiSubmit, ReplaceHelpImg - Upgraded CodeMirror to 2.37 - bug #2951 [export] Correctly export decimal fields. - bug #3762 [core] Make Advisor work on Windows withou COM extension. +- bug #3519 [export] Prevent infinite recursion in PDF export. 3.5.7.0 (not yet released) - bug #3779 [core] Problem with backslash in enum fields diff --git a/libraries/plugins/export/PMA_ExportPdf.class.php b/libraries/plugins/export/PMA_ExportPdf.class.php index 54f85e2521..1913d5ecd2 100644 --- a/libraries/plugins/export/PMA_ExportPdf.class.php +++ b/libraries/plugins/export/PMA_ExportPdf.class.php @@ -86,6 +86,11 @@ class PMA_ExportPdf extends PMA_PDF function Header() { global $maxY; + // We don't want automatic page breaks while generating header + // as this can lead to infinite recursion as auto generated page + // will want header as well causing another page break + // FIXME: Better approach might be to try to compact the content + $this->SetAutoPageBreak(false); // Check if header for this page already exists if (! isset($this->headerset[$this->page])) { $fullwidth = 0; @@ -152,6 +157,7 @@ class PMA_ExportPdf extends PMA_PDF } $this->dataY = $maxY; + $this->SetAutoPageBreak(true); } function morepagestable($lineheight = 8)