coding standards

This commit is contained in:
Loïc Chapeaux
2002-01-19 18:44:14 +00:00
parent 2d88726fcb
commit c9a7dca361
2 changed files with 38 additions and 38 deletions

View File

@@ -10,6 +10,7 @@ $Source$
* tbl_change.php3:
- beautify javascript code;
- line 363: fixed a js bug.
* read_dump.php3: coding standards (ident. = 4 space characters).
2002-01-18 Marc Delisle <lem9@users.sourceforge.net>
* Documentation.html, new download location for the RedHat PHP package,

View File

@@ -219,50 +219,49 @@ if (!empty($id_bookmark)) {
/**
* Prepares the sql query
*/
// Gets the query from a file if required
// Gets the query from a file if required
if ($sql_file != 'none') {
if (file_exists($sql_file) && is_uploaded_file($sql_file)) {
if (PMA_PHP_INT_VERSION >= 40000 ) {
$open_basedir = @ini_get('open_basedir');
}
if (PMA_PHP_INT_VERSION < 40000 ) {
$open_basedir = @get_cfg_var('open_basedir');
}
$open_basedir = '';
if (PMA_PHP_INT_VERSION >= 40000 ) {
$open_basedir = @ini_get('open_basedir');
}
if (empty($open_basedir)) {
$open_basedir = @get_cfg_var('open_basedir');
}
// if we are on a server with open_basedir, we must move
// the file before opening it. The doc explains how
// to create the ./tmp directory
// If we are on a server with open_basedir, we must move the file
// before opening it. The doc explains how to create the "./tmp"
// directory
if (!empty($open_basedir)) {
// check if '.' is in open_basedir
$pos = strpos($open_basedir,'.');
if (!empty($open_basedir)) {
// check if '.' is in open_basedir
$pos = strpos($open_basedir, '.');
// from the PHP annotated manual
if ( (PMA_PHP_INT_VERSION < 40000 && is_integer($pos) && !$pos)
|| (PMA_PHP_INT_VERSION >= 40000 && $pos === false) ) {
// if no '.' in openbasedir, do not move the file,
// force the error and let PHP report it
error_reporting(E_ALL);
$sql_query = fread(fopen($sql_file, 'r'), filesize($sql_file));
}
else {
$sql_file_new='./tmp/' . basename($sql_file);
if (PMA_PHP_INT_VERSION < 40003) {
copy($sql_file, $sql_file_new);
}
else {
move_uploaded_file($sql_file, $sql_file_new);
}
$sql_query = fread(fopen($sql_file_new, 'r'), filesize($sql_file_new));
unlink($sql_file_new);
}
}
else {
// read from the normal upload dir
$sql_query = fread(fopen($sql_file, 'r'), filesize($sql_file));
}
// from the PHP annotated manual
if ( (PMA_PHP_INT_VERSION < 40000 && is_integer($pos) && !$pos)
|| (PMA_PHP_INT_VERSION >= 40000 && $pos === false) ) {
// if no '.' in openbasedir, do not move the file, force the
// error and let PHP report it
error_reporting(E_ALL);
$sql_query = fread(fopen($sql_file, 'r'), filesize($sql_file));
}
else {
$sql_file_new = './tmp/' . basename($sql_file);
if (PMA_PHP_INT_VERSION < 40003) {
copy($sql_file, $sql_file_new);
} else {
move_uploaded_file($sql_file, $sql_file_new);
}
$sql_query = fread(fopen($sql_file_new, 'r'), filesize($sql_file_new));
unlink($sql_file_new);
}
}
else {
// read from the normal upload dir
$sql_query = fread(fopen($sql_file, 'r'), filesize($sql_file));
}
if (get_magic_quotes_runtime() == 1) {
$sql_query = stripslashes($sql_query);