2 /* vim: set expandtab sw=4 ts=4 sts=4: */
6 * This is the parser bug decoder system
7 * Throw the bug data in teh query box, and hit submit for output.
9 * Copyright 2002 Robin Johnson <robbat2@users.sourceforge.net>
11 * @package phpMyAdmin-debug
18 <!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
19 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
20 <html xmlns
="http://www.w3.org/1999/xhtml" xml
:lang
="en-US" lang
="en-US">
23 <link rel
="icon" href
="./favicon.ico" type
="image/x-icon" />
24 <link rel
="shortcut icon" href
="./favicon.ico" type
="image/x-icon" />
25 <meta http
-equiv
="Content-Type" content
="text/html; charset=iso-8859-1" />
26 <title
>phpMyAdmin
- Parser BUG decoder
</title
>
27 <style type
="text/css">
30 font
-family
: Arial
, Helvetica
, sans
-serif
;
34 font
-family
: Verdana
, Arial
, Helvetica
, sans
-serif
;
44 <body bgcolor
="#FFFFFF">
45 <h1
>Parser BUG decoder
</h1
>
48 <form method
="post" action
="./decode_bug.php">
49 <input type
="hidden" name
="bar" value
="<?php echo rand(); ?>" />
50 Encoded bug report
:<br
/>
51 <textarea name
="bug_encoded" cols
="72" rows
="10"></textarea
>
53 <input type
="submit" />
59 * If the form has been submitted -> decodes the bug report
63 * Display the decoded bug report in ASCII format
65 * @param string the text data
67 * @return string the text enclosed by "<pre>...</pre>" tags
71 function PMA_printDecodedBug($textdata)
73 return '<pre>' . htmlspecialchars($textdata) . '</pre><br />';
74 } // end of the "PMA_printDecodedBug()" function
77 if (!empty($_POST) && isset($_POST['bug_encoded'])) {
78 $bug_encoded = $_POST['bug_encoded'];
81 if (!empty($bug_encoded)) {
82 if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) {
83 $bug_encoded = stripslashes($bug_encoded);
86 $bug_encoded = preg_replace('/[[:space:]]/', '', $bug_encoded);
87 $bug_decoded = base64_decode($bug_encoded);
88 if (substr($bug_encoded, 0, 2) == 'eN') {
89 if (function_exists('gzuncompress')) {
90 $result = PMA_printDecodedBug(gzuncompress($bug_decoded));
92 $result = 'Error: "gzuncompress()" is unavailable!' . "\n";
95 $result = PMA_printDecodedBug($bug_decoded);
96 } // end if... else...
98 echo '<p>Decoded:</p>' . "\n"