Clickmap Graphical API and Pain Form
[openemr.git] / phpmyadmin / scripts / decode_bug.php
blob7dea1e249ba699ee2ec8ed1e3a410755dd1e6071
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Parser BUG decoder
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 * @version $Id$
12 * @package phpMyAdmin-debug
15 /**
16 * Displays the form
19 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
20 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
21 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
23 <head>
24 <link rel="icon" href="./favicon.ico" type="image/x-icon" />
25 <link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />
26 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
27 <title>phpMyAdmin - Parser BUG decoder</title>
28 <style type="text/css">
29 <!--
30 body, p {
31 font-family: Arial, Helvetica, sans-serif;
32 font-size: medium;
34 h1 {
35 font-family: Verdana, Arial, Helvetica, sans-serif;
36 font-size: large;
37 font-weight: bold;
38 color: #000066;
40 //-->
41 </style>
42 </head>
45 <body bgcolor="#FFFFFF">
46 <h1>Parser BUG decoder</h1>
47 <br />
49 <form method="post" action="./decode_bug.php">
50 <input type="hidden" name="bar" value="<?php echo rand(); ?>" />
51 Encoded bug report:<br />
52 <textarea name="bug_encoded" cols="72" rows="10"></textarea>
53 <br /><br />
54 <input type="submit" />
55 </form>
56 <hr />
58 <?php
59 /**
60 * If the form has been submitted -> decodes the bug report
63 /**
64 * Display the decoded bug report in ASCII format
66 * @param string the text data
68 * @return string the text enclosed by "<pre>...</pre>" tags
70 * @access public
72 function PMA_printDecodedBug($textdata)
74 return '<pre>' . htmlspecialchars($textdata) . '</pre><br />';
75 } // end of the "PMA_printDecodedBug()" function
78 if (!empty($_POST) && isset($_POST['bug_encoded'])) {
79 $bug_encoded = $_POST['bug_encoded'];
82 if (!empty($bug_encoded)) {
83 if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) {
84 $bug_encoded = stripslashes($bug_encoded);
87 $bug_encoded = ereg_replace('[[:space:]]', '', $bug_encoded);
88 $bug_decoded = base64_decode($bug_encoded);
89 if (substr($bug_encoded, 0, 2) == 'eN') {
90 if (function_exists('gzuncompress')) {
91 $result = PMA_printDecodedBug(gzuncompress($bug_decoded));
92 } else {
93 $result = 'Error: &quot;gzuncompress()&quot; is unavailable!' . "\n";
95 } else {
96 $result = PMA_printDecodedBug($bug_decoded);
97 } // end if... else...
99 echo '<p>Decoded:</p>' . "\n"
100 . $result . "\n";
101 } // end if
103 </body>
105 </html>