Added the path './' before all required or included files to avoid conflicts with the 'include_path' directive

This commit is contained in:
Loïc Chapeaux
2001-05-20 09:56:22 +00:00
parent 50df8b6678
commit dfa57ed7d8
28 changed files with 105 additions and 93 deletions

View File

@@ -5,6 +5,13 @@ phpMyAdmin - Changelog
$Id$
$Source$
2001-05-20 Lo<4C>c Chapeaux <lolo@phpheaven.net>
* replaced all require("somefile.php3") and include("somefile.php3")
instructions by require("./somefile.php3") and include("./somefile.php3")
to avoid conflicts with the 'include_path' directive.
Also ensured that require and include are conveniently used (no require
inside conditionnal structure...)
2001-05-19 Lo<4C>c Chapeaux <lolo@phpheaven.net>
* left.js, lines 241-242: fixed the scrollbar bug with NS4

View File

@@ -87,7 +87,7 @@ $cfgModifyDeleteAtRight = false;
$cfgDefaultLang = "en"; // default language to use, if not browser-defined or user-defined
// $cfgLang = "en"; // force: always use this language - must be defined in select_lang.inc.php3
require("select_lang.inc.php3"); // load language file
require("./select_lang.inc.php3"); // load language file
$cfgColumnTypes = array(

View File

@@ -2,13 +2,13 @@
/* $Id$ */
require("grab_globals.inc.php3");
require("./grab_globals.inc.php3");
require("header.inc.php3");
require("./header.inc.php3");
$result = mysql_query("CREATE DATABASE $db") or mysql_die();
$message = "$strDatabase $db $strHasBeenCreated";
require("db_details.php3");
require("./db_details.php3");
?>

View File

@@ -1,11 +1,11 @@
<?php
/* $Id$ */
require("grab_globals.inc.php3");
require("./grab_globals.inc.php3");
if(!isset($message))
{
include("header.inc.php3");
include("./header.inc.php3");
}
else
{
@@ -144,5 +144,5 @@ if($cfgBookmark['db'] && $cfgBookmark['table'])
</div>
<?php
require ("footer.inc.php3");
require("./footer.inc.php3");
?>

View File

@@ -2,20 +2,20 @@
/* $Id$ */
require("grab_globals.inc.php3");
require("./grab_globals.inc.php3");
@set_time_limit(600);
$crlf="\n";
if(empty($asfile))
{
include("header.inc.php3");
include("./header.inc.php3");
echo "<div align=left><pre>\n";
}
else
{
include("lib.inc.php3");
include("./lib.inc.php3");
header("Content-disposition: filename=$db.sql");
header("Content-type: application/octetstream");
header("Pragma: no-cache");
@@ -107,6 +107,6 @@ else
if(empty($asfile))
{
print "</pre></div>\n";
include ("footer.inc.php3");
include("./footer.inc.php3");
}
?>

View File

@@ -2,12 +2,12 @@
/* $Id$ */
require("grab_globals.inc.php3");
require("./grab_globals.inc.php3");
if(!isset($message))
{
include("header.inc.php3");
include("./header.inc.php3");
}
else
{
@@ -47,5 +47,5 @@ else
echo "</table>\n";
}
require ("footer.inc.php3");
require("./footer.inc.php3");
?>

View File

@@ -3,9 +3,9 @@
@set_time_limit(10000);
require("grab_globals.inc.php3");
require("./grab_globals.inc.php3");
require("lib.inc.php3");
require("./lib.inc.php3");
// set up default values
@@ -57,11 +57,11 @@ if($sql_query != "") {
if (count($pieces) == 1 && !empty($pieces[0]) && $view_bookmark == 0) {
$sql_query = addslashes(trim($pieces[0]));
if (eregi('^CREATE TABLE (.+)', $sql_query)) $reload = "true";
include ("sql.php3");
include("./sql.php3");
exit;
}
include("header.inc.php3");
include("./header.inc.php3");
if(mysql_select_db($db)) {
// run multiple queries
for ($i=0; $i<count($pieces); $i++) {
@@ -75,5 +75,5 @@ if($sql_query != "") {
// copy the original query back for display purposes
$sql_query = $sql_query_cpy;
$message = $strSuccess;
require("db_details.php3");
require("./db_details.php3");
?>

View File

@@ -1,7 +1,7 @@
<?php
/* $Id$ */
include("lib.inc.php3");
require("./lib.inc.php3");
?>
<html>

View File

@@ -1,6 +1,6 @@
<?php
// Process config file to determine default server (if any)
require('lib.inc.php3');
require('./lib.inc.php3');
?>
<html>

View File

@@ -14,7 +14,7 @@ LOAD DATA INFILE 'file_name.txt' [REPLACE | IGNORE] INTO TABLE table_name
require("grab_globals.inc.php3");
require("./grab_globals.inc.php3");
if (isset($btnLDI) && ($textfile != "none"))
@@ -62,9 +62,10 @@ if (isset($btnLDI) && ($textfile != "none"))
if(get_magic_quotes_gpc()) {
$sql_query = addslashes($query);
}
require("sql.php3");
include("./sql.php3");
}
else
{ require("ldi_table.php3");
{
include("./ldi_table.php3");
}
?>

View File

@@ -5,9 +5,9 @@
// This file inserts a textfile into a table
require("grab_globals.inc.php3");
require("./grab_globals.inc.php3");
require("header.inc.php3");
require("./header.inc.php3");
$tables = mysql_list_tables($db);
$num_tables = @mysql_numrows($tables);
@@ -72,5 +72,5 @@ $num_tables = @mysql_numrows($tables);
<?php
require ("footer.inc.php3");
require("./footer.inc.php3");
?>

View File

@@ -1,7 +1,7 @@
<?php
/* $Id$ */
require("lib.inc.php3");
require("./lib.inc.php3");
?>
<html>

View File

@@ -1,7 +1,7 @@
<?php
/* $Id$ */
require("config.inc.php3");
require("./config.inc.php3");
if(!defined("__LIB_INC__")) {
define("__LIB_INC__", 1);
@@ -80,7 +80,7 @@ function mysql_die($error = "") {
else
echo "$strMySQLSaid ".htmlspecialchars($error);
echo "\n<br><a href=\"javascript:history.go(-1)\">$strBack</a>";
include("footer.inc.php3");
include("./footer.inc.php3");
exit;
}
@@ -643,7 +643,7 @@ function mysql_die2($sql) {
echo "$strMySQLSaid ".htmlspecialchars($error);
echo "\n<br><a href=\"javascript:history.go(-1)\">$strBack</a>";
include("footer.inc.php3");
include("./footer.inc.php3");
exit;
}

View File

@@ -2,14 +2,14 @@
/* $Id$ */
require("grab_globals.inc.php3");
require("./grab_globals.inc.php3");
if (!isset($message)) {
include("header.inc.php3");
include("./header.inc.php3");
} else {
include("header.inc.php3");
include("lib.inc.php3");
include("./header.inc.php3");
include("./lib.inc.php3");
show_message($message);
}
?>
@@ -185,5 +185,5 @@ if (empty($cfgLang)) {
</div>
<?php
require ("footer.inc.php3");
require("./footer.inc.php3");
?>

View File

@@ -149,5 +149,5 @@ if (empty($lang)) {
// Define the associated filename and load the translation
$lang_file = $lang_path . $available_languages[$lang][1] . '.inc.php3';
require($lang_file);
require('./' . $lang_file);
?>

View File

@@ -2,9 +2,9 @@
/* $Id$ */;
require("grab_globals.inc.php3");
require("./grab_globals.inc.php3");
require("lib.inc.php3");
require("./lib.inc.php3");
if(isset($goto) && $goto == "sql.php3")
{
@@ -16,7 +16,7 @@ if(isset($goto) && $goto == "sql.php3")
if(isset($btnDrop) && $btnDrop == $strNo) {
if(file_exists("./$goto")) {
include(preg_replace('/\.\.*/', '.', $goto));
include('./' . preg_replace('/\.\.*/', '.', $goto));
} else {
Header("Location: $goto");
}
@@ -35,7 +35,7 @@ if($is_drop_sql_query && !isset($btnDrop)) {
} else {
$stripped_sql_query = $sql_query;
}
include("header.inc.php3");
include("./header.inc.php3");
echo $strDoYouReally.urldecode($stripped_sql_query)."?<br>";
?>
<form action="sql.php3" method="post" enctype="application/x-www-form-urlencoded">
@@ -79,7 +79,7 @@ else {
if(!$result)
{
$error = mysql_error();
include("header.inc.php3");
include("./header.inc.php3");
mysql_die($error);
}
@@ -89,12 +89,12 @@ else {
{
if(file_exists("./$goto"))
{
include("header.inc.php3");
include("./header.inc.php3");
if(isset($zero_rows) && !empty($zero_rows))
$message = $zero_rows;
else
$message = $strEmptyResultSet;
include(preg_replace('/\.\.*/', '.', $goto));
include('./' . preg_replace('/\.\.*/', '.', $goto));
}
else
{
@@ -105,7 +105,7 @@ else {
}
else
{
include("header.inc.php3");
include("./header.inc.php3");
display_table($result);
if(!eregi("SHOW VARIABLES|SHOW PROCESSLIST|SHOW STATUS", $sql_query))
{
@@ -138,5 +138,5 @@ else {
}
}
} //ne drop query
require ("footer.inc.php3");
require("./footer.inc.php3");
?>

View File

@@ -2,9 +2,9 @@
/* $Id$ */
require("grab_globals.inc.php3");
require("./grab_globals.inc.php3");
require("header.inc.php3");
require("./header.inc.php3");
if(isset($submit))
{
@@ -132,14 +132,14 @@ if(isset($submit))
$query_keys = ereg_replace(", $", "", $query_keys);
$message = "$strTable $table $strHasBeenAltered";
include("tbl_properties.php3");
include("./tbl_properties.php3");
exit;
}
else
{
$action = "tbl_addfield.php3";
include("tbl_properties.inc.php3");
include("./tbl_properties.inc.php3");
}
require ("footer.inc.php3");
require("./footer.inc.php3");
?>

View File

@@ -2,9 +2,9 @@
/* $Id$ */
require("grab_globals.inc.php3");
require("./grab_globals.inc.php3");
require("header.inc.php3");
require("./header.inc.php3");
if(isset($submit))
{
@@ -26,7 +26,7 @@ if(isset($submit))
$sql_query = "ALTER TABLE $table CHANGE $query";
$result = mysql_db_query($db, $sql_query) or mysql_die();
$message = "$strTable $table $strHasBeenAltered";
include("tbl_properties.php3");
include("./tbl_properties.php3");
exit;
}
else
@@ -34,8 +34,8 @@ else
$result = mysql_db_query($db, "SHOW FIELDS FROM $table LIKE '$field'") or mysql_die();
$num_fields = mysql_num_rows($result);
$action = "tbl_alter.php3";
include("tbl_properties.inc.php3");
include("./tbl_properties.inc.php3");
}
require ("footer.inc.php3");
require("./footer.inc.php3");
?>

View File

@@ -2,9 +2,9 @@
/* $Id$ */
require("grab_globals.inc.php3");
require("./grab_globals.inc.php3");
require("header.inc.php3");
require("./header.inc.php3");
$table_def = mysql_db_query($db, "SHOW FIELDS FROM $table");
@@ -155,5 +155,5 @@ echo "</table>";
</form>
<?php
require ("footer.inc.php3");
require("./footer.inc.php3");
?>

View File

@@ -2,9 +2,9 @@
/* $Id$ */
require("grab_globals.inc.php3");
require("./grab_globals.inc.php3");
require("header.inc.php3");
require("./header.inc.php3");
function my_handler($sql_insert)
{
@@ -32,5 +32,5 @@ if($what == "data")
get_table_content($db, $table, "my_handler");
eval("\$message = \"$strCopyTableOK\";");
include("db_details.php3");
require("./db_details.php3");
?>

View File

@@ -2,9 +2,9 @@
/* $Id$ */
require("grab_globals.inc.php3");
require("./grab_globals.inc.php3");
require("header.inc.php3");
require("./header.inc.php3");
if(isset($submit))
{
@@ -87,14 +87,14 @@ if(isset($submit))
$sql_query .= " comment = '$comment'";
$result = mysql_db_query($db, $sql_query) or mysql_die();
$message = "$strTable $table $strHasBeenCreated";
include("tbl_properties.php3");
include("./tbl_properties.php3");
exit;
}
else
{
$action = "tbl_create.php3";
include("tbl_properties.inc.php3");
include("./tbl_properties.inc.php3");
}
require ("footer.inc.php3");
require("./footer.inc.php3");
?>

View File

@@ -2,7 +2,7 @@
/* $Id$ */
require("grab_globals.inc.php3");
require("./grab_globals.inc.php3");
@set_time_limit(600);
@@ -10,12 +10,12 @@ $crlf="\n";
if(empty($asfile))
{
include("header.inc.php3");
include("./header.inc.php3");
print "<div align=left><pre>\n";
}
else
{
include("lib.inc.php3");
include("./lib.inc.php3");
$ext = "sql";
if($what == "csv")
$ext = "csv";
@@ -99,6 +99,6 @@ else
if(empty($asfile))
{
print "</pre></div>\n";
include ("footer.inc.php3");
include("./footer.inc.php3");
}
?>

View File

@@ -2,15 +2,17 @@
/* $Id$ */
require("grab_globals.inc.php3");
require("./grab_globals.inc.php3");
if(!isset($message))
{
include("header.inc.php3");
include("./header.inc.php3");
}
else
{
show_message($message);
}
unset($sql_query);
if(MYSQL_MAJOR_VERSION == "3.23")
@@ -135,5 +137,5 @@ if(mysql_num_rows($result)>0)
print "</table>\n";
}
require ("footer.inc.php3");
require("./footer.inc.php3");
?>

View File

@@ -2,15 +2,17 @@
/* $Id$ */
require("grab_globals.inc.php3");
require("./grab_globals.inc.php3");
if(!isset($message))
{
include("header.inc.php3");
include("./header.inc.php3");
}
else
{
show_message($message);
}
unset($sql_query);
if(MYSQL_MAJOR_VERSION == "3.23")
@@ -321,5 +323,5 @@ echo " </select>\n";
</div>
<?php
require ("footer.inc.php3");
require("./footer.inc.php3");
?>

View File

@@ -2,10 +2,10 @@
/* $Id$ */
require("grab_globals.inc.php3");
require("./grab_globals.inc.php3");
require( "header.inc.php3");
require("./header.inc.php3");
if(empty($Columns))
$Columns = 3; # initial number of columns
@@ -517,5 +517,5 @@ echo "</textarea></form></td></tr></table>";
?>
<?php
require ( "footer.inc.php3");
require("./footer.inc.php3");
?>

View File

@@ -2,16 +2,16 @@
/* $Id$ */
require("grab_globals.inc.php3");
require("./grab_globals.inc.php3");
$old_name = $table;
$table = $new_name;
require("header.inc.php3");
require("./header.inc.php3");
$result = mysql_db_query($db, "ALTER TABLE $old_name RENAME $new_name") or mysql_die();
$table = $old_name;
eval("\$message = \"$strRenameTableOK\";");
$table = $new_name;
include("tbl_properties.php3");
require("./tbl_properties.php3");
?>

View File

@@ -2,9 +2,9 @@
/* $Id$ */
require("grab_globals.inc.php3");
require("./grab_globals.inc.php3");
require("lib.inc.php3");
require("./lib.inc.php3");
if($goto == "sql.php3")
@@ -93,13 +93,13 @@ $result = mysql_db_query($db, $query);
if(!$result) {
$error = mysql_error();
include("header.inc.php3");
include("./header.inc.php3");
mysql_die($error);
} else {
if(file_exists("./$goto")) {
include("header.inc.php3");
include("./header.inc.php3");
$message = $strModifications;
include(preg_replace('/\.\.*/', '.', $goto));
include('./' . preg_replace('/\.\.*/', '.', $goto));
} else {
Header("Location: $goto");
}

View File

@@ -2,11 +2,11 @@
/* $Id$ */
require("grab_globals.inc.php3");
require("./grab_globals.inc.php3");
if(!isset($param) || $param[0] == "") {
include("header.inc.php3");
include("./header.inc.php3");
$result = mysql_list_fields($db, $table);
if (!$result) {
mysql_die();
@@ -71,7 +71,7 @@ if(!isset($param) || $param[0] == "") {
<?php
}
include("footer.inc.php3");
include("./footer.inc.php3");
}
else {
$sql_query="SELECT $param[0]";
@@ -108,7 +108,7 @@ else {
}
}
if (empty($sessionMaxRows)) {
include("config.inc.php3");
include("./config.inc.php3");
$sessionMaxRows = $cfgMaxRows;
}
Header("Location:sql.php3?sql_query=".urlencode($sql_query)."&goto=db_details.php3&server=$server&lang=$lang&db=$db&table=$table&pos=0&sessionMaxRows=$sessionMaxRows");