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
?>