From dfa57ed7d8b60c1eb1ef4ca7f934a6a400e58297 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Chapeaux?= Date: Sun, 20 May 2001 09:56:22 +0000 Subject: [PATCH] Added the path './' before all required or included files to avoid conflicts with the 'include_path' directive --- ChangeLog | 7 +++++++ config.inc.php3 | 2 +- db_create.php3 | 6 +++--- db_details.php3 | 6 +++--- db_dump.php3 | 8 ++++---- db_printview.php3 | 6 +++--- db_readdump.php3 | 10 +++++----- header.inc.php3 | 2 +- index.php3 | 2 +- ldi_check.php3 | 7 ++++--- ldi_table.php3 | 6 +++--- left.php3 | 2 +- lib.inc.php3 | 6 +++--- main.php3 | 10 +++++----- select_lang.inc.php3 | 2 +- sql.php3 | 18 +++++++++--------- tbl_addfield.php3 | 10 +++++----- tbl_alter.php3 | 10 +++++----- tbl_change.php3 | 6 +++--- tbl_copy.php3 | 6 +++--- tbl_create.php3 | 10 +++++----- tbl_dump.php3 | 8 ++++---- tbl_printview.php3 | 10 ++++++---- tbl_properties.php3 | 8 +++++--- tbl_qbe.php3 | 6 +++--- tbl_rename.php3 | 6 +++--- tbl_replace.php3 | 10 +++++----- tbl_select.php3 | 8 ++++---- 28 files changed, 105 insertions(+), 93 deletions(-) diff --git a/ChangeLog b/ChangeLog index e9c77290f..bf3675974 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,13 @@ phpMyAdmin - Changelog $Id$ $Source$ +2001-05-20 Loïc Chapeaux + * 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ïc Chapeaux * left.js, lines 241-242: fixed the scrollbar bug with NS4 diff --git a/config.inc.php3 b/config.inc.php3 index 62909b669..bc9361001 100755 --- a/config.inc.php3 +++ b/config.inc.php3 @@ -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( diff --git a/db_create.php3 b/db_create.php3 index 234b75e42..6fd225891 100755 --- a/db_create.php3 +++ b/db_create.php3 @@ -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"); ?> diff --git a/db_details.php3 b/db_details.php3 index d7d54e1ba..12ca8c806 100755 --- a/db_details.php3 +++ b/db_details.php3 @@ -1,11 +1,11 @@ diff --git a/db_dump.php3 b/db_dump.php3 index 7009e7056..36aaaad70 100755 --- a/db_dump.php3 +++ b/db_dump.php3 @@ -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 "
\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 "
\n"; - include ("footer.inc.php3"); + include("./footer.inc.php3"); } ?> diff --git a/db_printview.php3 b/db_printview.php3 index 556f1c465..aa951fa86 100755 --- a/db_printview.php3 +++ b/db_printview.php3 @@ -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 "\n"; } -require ("footer.inc.php3"); +require("./footer.inc.php3"); ?> diff --git a/db_readdump.php3 b/db_readdump.php3 index 950dd92bf..0c8bd149f 100755 --- a/db_readdump.php3 +++ b/db_readdump.php3 @@ -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 \ No newline at end of file diff --git a/header.inc.php3 b/header.inc.php3 index 83d478e26..2feb963c6 100755 --- a/header.inc.php3 +++ b/header.inc.php3 @@ -1,7 +1,7 @@ diff --git a/index.php3 b/index.php3 index 394dc3117..283668b5f 100755 --- a/index.php3 +++ b/index.php3 @@ -1,6 +1,6 @@ diff --git a/ldi_check.php3 b/ldi_check.php3 index 7ffc5d62b..1b108ac2a 100755 --- a/ldi_check.php3 +++ b/ldi_check.php3 @@ -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"); } ?> diff --git a/ldi_table.php3 b/ldi_table.php3 index 65d931d13..97f10c097 100755 --- a/ldi_table.php3 +++ b/ldi_table.php3 @@ -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); diff --git a/left.php3 b/left.php3 index 15460684d..3bae5d68b 100755 --- a/left.php3 +++ b/left.php3 @@ -1,7 +1,7 @@ diff --git a/lib.inc.php3 b/lib.inc.php3 index 48272278e..cb13c8c4f 100755 --- a/lib.inc.php3 +++ b/lib.inc.php3 @@ -1,7 +1,7 @@ $strBack"; - include("footer.inc.php3"); + include("./footer.inc.php3"); exit; } @@ -643,7 +643,7 @@ function mysql_die2($sql) { echo "$strMySQLSaid ".htmlspecialchars($error); echo "\n
$strBack"; - include("footer.inc.php3"); + include("./footer.inc.php3"); exit; } diff --git a/main.php3 b/main.php3 index a9d14a226..4015d0dc6 100755 --- a/main.php3 +++ b/main.php3 @@ -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)) { diff --git a/select_lang.inc.php3 b/select_lang.inc.php3 index 845aee307..dfb89e8ec 100755 --- a/select_lang.inc.php3 +++ b/select_lang.inc.php3 @@ -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); ?> \ No newline at end of file diff --git a/sql.php3 b/sql.php3 index 41ea358f9..127d7669f 100755 --- a/sql.php3 +++ b/sql.php3 @@ -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)."?
"; ?>
@@ -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"); ?> \ No newline at end of file diff --git a/tbl_addfield.php3 b/tbl_addfield.php3 index 51f503431..88a9668bd 100755 --- a/tbl_addfield.php3 +++ b/tbl_addfield.php3 @@ -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"); ?> diff --git a/tbl_alter.php3 b/tbl_alter.php3 index 0e96d900f..4908dfd51 100755 --- a/tbl_alter.php3 +++ b/tbl_alter.php3 @@ -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"); ?> diff --git a/tbl_change.php3 b/tbl_change.php3 index d387bc9d4..3049eb0c8 100755 --- a/tbl_change.php3 +++ b/tbl_change.php3 @@ -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 "";
diff --git a/tbl_copy.php3 b/tbl_copy.php3 index e146534f6..8dea084b4 100755 --- a/tbl_copy.php3 +++ b/tbl_copy.php3 @@ -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"); ?> diff --git a/tbl_create.php3 b/tbl_create.php3 index e88fa80ad..8da5ae334 100755 --- a/tbl_create.php3 +++ b/tbl_create.php3 @@ -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"); ?> diff --git a/tbl_dump.php3 b/tbl_dump.php3 index 2be325cd9..b95ad7132 100755 --- a/tbl_dump.php3 +++ b/tbl_dump.php3 @@ -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 "
\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 "
\n"; - include ("footer.inc.php3"); + include("./footer.inc.php3"); } ?> diff --git a/tbl_printview.php3 b/tbl_printview.php3 index bfdb3450b..641e1a1a0 100755 --- a/tbl_printview.php3 +++ b/tbl_printview.php3 @@ -2,16 +2,18 @@ /* $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 "\n"; } -require ("footer.inc.php3"); +require("./footer.inc.php3"); ?> diff --git a/tbl_properties.php3 b/tbl_properties.php3 index 6296eb00c..795d9532d 100755 --- a/tbl_properties.php3 +++ b/tbl_properties.php3 @@ -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 " \n"; diff --git a/tbl_qbe.php3 b/tbl_qbe.php3 index f85e68de2..fe7074ac7 100755 --- a/tbl_qbe.php3 +++ b/tbl_qbe.php3 @@ -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 ""; ?> diff --git a/tbl_rename.php3 b/tbl_rename.php3 index 194b5f30a..7af0e69b2 100755 --- a/tbl_rename.php3 +++ b/tbl_rename.php3 @@ -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"); ?> diff --git a/tbl_replace.php3 b/tbl_replace.php3 index fd1b27449..7ab9224e0 100755 --- a/tbl_replace.php3 +++ b/tbl_replace.php3 @@ -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"); } diff --git a/tbl_select.php3 b/tbl_select.php3 index 53f8b57c4..c807c74a3 100755 --- a/tbl_select.php3 +++ b/tbl_select.php3 @@ -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] == "") {