From dae1c7b7413a636f4003657e058ea3e2e04bac00 Mon Sep 17 00:00:00 2001 From: Robin Johnson Date: Wed, 7 Aug 2002 05:46:48 +0000 Subject: [PATCH] * scripts/decode_bug.php3: - Cleaned up code to use
 arouund output

---
 scripts/decode_bug.php3 | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/scripts/decode_bug.php3 b/scripts/decode_bug.php3
index 2e8ce9812..21704f6dd 100644
--- a/scripts/decode_bug.php3
+++ b/scripts/decode_bug.php3
@@ -56,7 +56,13 @@
 /**
  * If the form has been submitted -> decodes the bug report
  */
-if (!empty($_POST) && isset($_POST['bug_encoded'])) {
+function PMA_printDecodedBug($textdata)
+{
+    return 'Decoded:
' . "\n" + . '
' . $textdata . '

' . "\n"; + } + + if (!empty($_POST) && isset($_POST['bug_encoded'])) { $bug_encoded = $_POST['bug_encoded']; } else if (!empty($HTTP_POST_VARS) && isset($HTTP_POST_VARS['bug_encoded'])) { @@ -72,17 +78,16 @@ if (!empty($bug_encoded)) { $bug_decoded = base64_decode($bug_encoded); if (substr($bug_encoded, 0, 2) == 'eN') { if (function_exists('gzuncompress')) { - $result = ' Decoded:
' . "\n" - . ' ' . gzuncompress($bug_decoded) . '
' . "\n"; - } else { + $result = PMA_printDecodedBug(gzuncompress($bug_decoded)); + } else { $result = 'Error: "gzuncompress()" is unavailable!' . "\n"; } } else { - $result = ' Decoded:
' . "\n" - . ' ' . $bug_decoded . '
'. "\n"; + $result = PMA_printDecodedBug($bug_decoded); } // end if... else... + echo '

' . "\n" . $result . '

' . "\n"; } // end if ?>