Merge branch 'QA_3_3'
[phpmyadmin/gandalfml.git] / error.php
blobb1d47e245650f6f02d87911b75f431e4b9d4cbf7
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * phpMyAdmin fatal error display page
6 * @package phpMyAdmin
7 */
9 /**
10 * Input sanitizing.
12 require './libraries/sanitizing.lib.php';
14 /* Get variables */
15 if (! empty($_REQUEST['lang']) && is_string($_REQUEST['lang'])) {
16 $lang = htmlspecialchars($_REQUEST['lang']);
17 } else {
18 $lang = 'en';
21 if (! empty($_REQUEST['dir']) && is_string($_REQUEST['dir'])) {
22 $dir = htmlspecialchars($_REQUEST['dir']);
23 } else {
24 $dir = 'ltr';
27 if (! empty($_REQUEST['type']) && is_string($_REQUEST['type'])) {
28 $type = htmlspecialchars($_REQUEST['type']);
29 } else {
30 $type = 'error';
33 // force utf-8 to avoid XSS with crafted URL and utf-7 in charset parameter
34 $charset = 'utf-8';
36 header('Content-Type: text/html; charset=' . $charset);
38 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
39 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $lang; ?>" dir="<?php echo $dir; ?>">
40 <head>
41 <link rel="icon" href="./favicon.ico" type="image/x-icon" />
42 <link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />
43 <title>phpMyAdmin</title>
44 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset; ?>" />
45 <style type="text/css">
46 <!--
47 html {
48 padding: 0;
49 margin: 0;
51 body {
52 font-family: sans-serif;
53 font-size: small;
54 color: #000000;
55 background-color: #F5F5F5;
56 margin: 1em;
58 h1 {
59 margin: 0;
60 padding: 0.3em;
61 font-size: 1.4em;
62 font-weight: bold;
63 color: #ffffff;
64 background-color: #ff0000;
66 p {
67 margin: 0;
68 padding: 0.5em;
69 border: 0.1em solid red;
70 background-color: #ffeeee;
72 //-->
73 </style>
74 </head>
75 <body>
76 <h1>phpMyAdmin - <?php echo $type; ?></h1>
77 <p><?php
78 if (!empty($_REQUEST['error'])) {
79 if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) {
80 echo PMA_sanitize(stripslashes($_REQUEST['error']));
81 } else {
82 echo PMA_sanitize($_REQUEST['error']);
84 } else {
85 echo 'No error message!';
87 ?></p>
88 </body>
89 </html>