patch #1258978, move common code for error pages out of common.lib.php
This commit is contained in:
@@ -6,6 +6,10 @@ $Id$
|
|||||||
$Source$
|
$Source$
|
||||||
|
|
||||||
2005-08-20 Marc Delisle <lem9@users.sourceforge.net>
|
2005-08-20 Marc Delisle <lem9@users.sourceforge.net>
|
||||||
|
* libraries/common.lib.php, new error.php: patch #1258978, move common
|
||||||
|
code for error pages out of common.lib.php, thanks to Sebastian Mendel
|
||||||
|
|
||||||
|
2005-08-19 Marc Delisle <lem9@users.sourceforge.net>
|
||||||
* lang/chinese_traditional: Updates, thanks to Siu Sun.
|
* lang/chinese_traditional: Updates, thanks to Siu Sun.
|
||||||
* lang/japanese: updated, thanks to Tadashi Jokagi (elf2000)
|
* lang/japanese: updated, thanks to Tadashi Jokagi (elf2000)
|
||||||
|
|
||||||
|
61
error.php
Normal file
61
error.php
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
<?php
|
||||||
|
/* $Id$ */
|
||||||
|
// vim: expandtab sw=4 ts=4 sts=4:
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* phpMyAdmin fatal error display page
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
$lang = isset( $_REQUEST['lang'] ) ? $_REQUEST['lang'] : 'en';
|
||||||
|
$dir = isset( $_REQUEST['dir'] ) ? $_REQUEST['dir'] : 'ltr';
|
||||||
|
$char = isset( $_REQUEST['char'] ) ? $_REQUEST['char'] : 'utf-8';
|
||||||
|
$type = isset( $_REQUEST['type'] ) ? $_REQUEST['type'] : 'error';
|
||||||
|
|
||||||
|
header('Content-Type: text/html; charset=' . $char);
|
||||||
|
?>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $lang; ?>" dir="<?php echo $dir; ?>">
|
||||||
|
<head>
|
||||||
|
<title>phpMyAdmin</title>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $char; ?>" />
|
||||||
|
<style type="text/css">
|
||||||
|
<!--
|
||||||
|
html {
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
body {
|
||||||
|
font-family: sans-serif;
|
||||||
|
font-size: small;
|
||||||
|
color: #000000;
|
||||||
|
background-color: #F5F5F5;
|
||||||
|
margin: 1em;
|
||||||
|
}
|
||||||
|
h1 {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0.3em;
|
||||||
|
font-size: 1.4em;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #ffffff;
|
||||||
|
background-color: #ff0000;
|
||||||
|
}
|
||||||
|
p {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0.5em;
|
||||||
|
border: 0.1em solid red;
|
||||||
|
background-color: #ffeeee;
|
||||||
|
}
|
||||||
|
//-->
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>phpMyAdmin - <?php echo $type; ?></h1>
|
||||||
|
<p><?php
|
||||||
|
if (get_magic_quotes_gpc()) {
|
||||||
|
echo stripslashes($_REQUEST['error']); }
|
||||||
|
else {
|
||||||
|
echo $_REQUEST['error'];
|
||||||
|
}?></p>
|
||||||
|
</body>
|
||||||
|
</html>
|
@@ -96,37 +96,17 @@ if ($result === FALSE || (!isset($cfgServers) && !isset($cfg['Servers']))) {
|
|||||||
'AllowAnywhereRecoding' => FALSE);
|
'AllowAnywhereRecoding' => FALSE);
|
||||||
// Loads the language file
|
// Loads the language file
|
||||||
require_once('./libraries/select_lang.lib.php');
|
require_once('./libraries/select_lang.lib.php');
|
||||||
// Sends the Content-Type header
|
|
||||||
header('Content-Type: text/html; charset=' . $charset);
|
|
||||||
// Displays the error message
|
// Displays the error message
|
||||||
?>
|
// (do not use & for parameters sent by header)
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
header( 'Location: error.php'
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
. '?lang=' . urlencode( $available_languages[$lang][2] )
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $available_languages[$lang][2]; ?>" lang="<?php echo $available_languages[$lang][2]; ?>" dir="<?php echo $text_dir; ?>">
|
. '&char=' . urlencode( $charset )
|
||||||
|
. '&dir=' . urlencode( $text_dir )
|
||||||
<head>
|
. '&type=' . urlencode( $strError )
|
||||||
<title>phpMyAdmin</title>
|
. '&error=' . urlencode( $strConfigFileError . '<br /><br />'
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset; ?>" />
|
. '<a href="' . $cfgfile_to_load . '" '
|
||||||
|
. 'target="_blank">' . $cfgfile_to_load . '</a>' )
|
||||||
<style type="text/css">
|
);
|
||||||
<!--
|
|
||||||
body {font-family: sans-serif; font-size: small; color: #000000; background-color: #F5F5F5}
|
|
||||||
h1 {font-family: sans-serif; font-size: large; font-weight: bold}
|
|
||||||
//-->
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
|
|
||||||
<body bgcolor="#ffffff">
|
|
||||||
<h1>phpMyAdmin - <?php echo $strError; ?></h1>
|
|
||||||
<p>
|
|
||||||
<?php echo $strConfigFileError; ?><br /><br />
|
|
||||||
<a href="<?php echo $cfgfile_to_load; ?>" target="_blank"><?php echo $cfgfile_to_load; ?></a>
|
|
||||||
</p>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
||||||
<?php
|
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
error_reporting($old_error_reporting);
|
error_reporting($old_error_reporting);
|
||||||
@@ -1074,35 +1054,14 @@ if ($is_minimum_common == FALSE) {
|
|||||||
} else if (!empty($_SERVER['SERVER_NAME'])) {
|
} else if (!empty($_SERVER['SERVER_NAME'])) {
|
||||||
$url['host'] = $_SERVER['SERVER_NAME'];
|
$url['host'] = $_SERVER['SERVER_NAME'];
|
||||||
} else {
|
} else {
|
||||||
header('Content-Type: text/html; charset=' . $charset);
|
|
||||||
// Displays the error message
|
// Displays the error message
|
||||||
?>
|
header( 'Location: error.php'
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
. '?lang=' . urlencode( $available_languages[$lang][2] )
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
. '&char=' . urlencode( $charset )
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $available_languages[$lang][2]; ?>" lang="<?php echo $available_languages[$lang][2]; ?>" dir="<?php echo $text_dir; ?>">
|
. '&dir=' . urlencode( $text_dir )
|
||||||
|
. '&type=' . urlencode( $strError )
|
||||||
<head>
|
. '&error=' . urlencode( $strPmaUriError )
|
||||||
<title>phpMyAdmin</title>
|
);
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset; ?>" />
|
|
||||||
|
|
||||||
<style type="text/css">
|
|
||||||
<!--
|
|
||||||
body {font-family: sans-serif; font-size: small; color: #000000; background-color: #F5F5F5}
|
|
||||||
h1 {font-family: sans-serif; font-size: large; font-weight: bold}
|
|
||||||
//-->
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
|
|
||||||
<body bgcolor="#ffffff">
|
|
||||||
<h1>phpMyAdmin - <?php echo $strError; ?></h1>
|
|
||||||
<p>
|
|
||||||
<?php echo $strPmaUriError; ?><br /><br />
|
|
||||||
</p>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
||||||
<?php
|
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user