update
[phpmyadmin/crack.git] / scripts / decode_bug.php3
blob1ae0332eb5da2b70b53bdb96758c1dc6087ff652
1 <?php
2 /* $Id$ */
3 // vim: expandtab sw=4 ts=4 sts=4 foldmarker={,} fdm=marker:
6 /**
7 * Parser BUG decoder
9 * This is the parser bug decoder system
10 * Throw the bug data in teh query box, and hit submit for output.
12 * Copyright 2002 Robin Johnson <robbat2@users.sourceforge.net>
16 /**
17 * Displays the form
20 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
21 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
22 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
24 <head>
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">
28 <!--
29 body, p {
30 font-family: Arial, Helvetica, sans-serif;
31 font-size: medium;
33 h1 {
34 font-family: Verdana, Arial, Helvetica, sans-serif;
35 font-size: large;
36 font-weight: bold;
37 color: #000066;
39 //-->
40 </style>
41 </head>
44 <body bgcolor="#FFFFFF">
45 <h1>Parser BUG decoder</h1>
46 <br />
48 <form method="post" action="./decode_bug.php3">
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>
52 <br /><br />
53 <input type="submit" />
54 </form>
55 <hr />
57 <?php
58 /**
59 * If the form has been submitted -> decodes the bug report
62 /**
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
69 * @access public
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'];
80 else if (!empty($HTTP_POST_VARS) && isset($HTTP_POST_VARS['bug_encoded'])) {
81 $bug_encoded = $HTTP_POST_VARS['bug_encoded'];
84 if (!empty($bug_encoded)) {
85 if (get_magic_quotes_gpc()) {
86 $bug_encoded = stripslashes($bug_encoded);
89 $bug_encoded = ereg_replace('[[:space:]]', '', $bug_encoded);
90 $bug_decoded = base64_decode($bug_encoded);
91 if (substr($bug_encoded, 0, 2) == 'eN') {
92 if (function_exists('gzuncompress')) {
93 $result = PMA_printDecodedBug(gzuncompress($bug_decoded));
94 } else {
95 $result = 'Error: &quot;gzuncompress()&quot; is unavailable!' . "\n";
98 else {
99 $result = PMA_printDecodedBug($bug_decoded);
100 } // end if... else...
102 echo '<p>Decoded:</p>' . "\n"
103 . $result . "\n";
104 } // end if
106 </body>
108 </html>