Merge branch 'QA_4_5' into QA_4_6

This commit is contained in:
Michal Čihař 2016-02-12 13:47:04 +01:00
commit 0c34cb60a0
11 changed files with 16 additions and 17 deletions

View File

@ -69,6 +69,8 @@ phpMyAdmin - ChangeLog
- issue #11946 Correctly store and report file upload errors
- issue #11948 Avoid javascript errors on invalid location hash
- issue #11950 Fix PHP warning on configuration errors
- issue #11951 Silent errors on checking for writable folders
- issue #11952 Silent warning on invalid file upload
4.5.4.1 (2016-01-29)
- issue #11892 Error with PMA 4.4.15.3

View File

@ -20,7 +20,7 @@ $filename = CHANGELOG_FILE;
* Read changelog.
*/
// Check if the file is available, some distributions remove these.
if (is_readable($filename)) {
if (@is_readable($filename)) {
// Test if the if is in a compressed format
if (substr($filename, -3) == '.gz') {

View File

@ -452,7 +452,7 @@ if ($import_file != 'none' && ! $error) {
$tmp_subdir = sys_get_temp_dir();
}
$tmp_subdir = rtrim($tmp_subdir, DIRECTORY_SEPARATOR);
if (is_writable($tmp_subdir)) {
if (@is_writable($tmp_subdir)) {
$import_file_new = $tmp_subdir . DIRECTORY_SEPARATOR
. basename($import_file) . uniqid();
if (move_uploaded_file($import_file, $import_file_new)) {

View File

@ -1113,12 +1113,12 @@ class Config
return false;
}
if (! file_exists($this->getSource())) {
if (! @file_exists($this->getSource())) {
$this->source_mtime = 0;
return false;
}
if (! is_readable($this->getSource())) {
if (! @is_readable($this->getSource())) {
// manually check if file is readable
// might be bug #3059806 Supporting running from CIFS/Samba shares

View File

@ -439,10 +439,7 @@ class File
{
// suppress warnings from being displayed, but not from being logged
// any file access outside of open_basedir will issue a warning
ob_start();
$is_readable = is_readable($this->getName());
ob_end_clean();
return $is_readable;
return @is_readable($this->getName());
}
/**
@ -461,7 +458,7 @@ class File
}
if (empty($GLOBALS['cfg']['TempDir'])
|| ! is_writable($GLOBALS['cfg']['TempDir'])
|| ! @is_writable($GLOBALS['cfg']['TempDir'])
) {
// cannot create directory or access, point user to FAQ 1.11
$this->_error_message = __(

View File

@ -337,7 +337,7 @@ function PMA_openExportFile($filename, $quick_export)
)
);
$message->addParam($save_filename);
} elseif (is_file($save_filename) && ! is_writable($save_filename)) {
} elseif (@is_file($save_filename) && ! @is_writable($save_filename)) {
$message = Message::error(
__(
'The web server does not have permission '

View File

@ -25,7 +25,7 @@ function PMA_getDirContent($dir, $expression = '')
$dir .= '/';
}
while ($file = @readdir($handle)) {
if (is_file($dir . $file)
if (@is_file($dir . $file)
&& ($expression == '' || preg_match($expression, $file))
) {
$result[] = $file;

View File

@ -83,7 +83,7 @@ class ImportShp extends ImportPlugin
// and use the files in it for import
if ($compression == 'application/zip'
&& !empty($GLOBALS['cfg']['TempDir'])
&& is_writable($GLOBALS['cfg']['TempDir'])
&& @is_writable($GLOBALS['cfg']['TempDir'])
) {
$dbf_file_name = PMA_findFileFromZipArchive(
'/^.*\.dbf$/i',

View File

@ -25,7 +25,7 @@ header('Content-type: text/plain; charset=utf-8');
$filename = LICENSE_FILE;
// Check if the file is available, some distributions remove these.
if (is_readable($filename)) {
if (@is_readable($filename)) {
readfile($filename);
} else {
printf(

View File

@ -60,7 +60,7 @@ if (isset($_POST['submit_export'])
// directory
if (!empty($open_basedir)) {
$tmp_subdir = (PMA_IS_WINDOWS ? '.\\tmp\\' : 'tmp/');
if (is_writable($tmp_subdir)) {
if (@is_writable($tmp_subdir)) {
$import_file_new = tempnam($tmp_subdir, 'prefs');
if (move_uploaded_file($import_file, $import_file_new)) {
$import_file = $import_file_new;

View File

@ -201,13 +201,13 @@ function PMA_checkConfigRw(&$is_readable, &$is_writable, &$file_exists)
$file_path = $GLOBALS['ConfigFile']->getFilePath();
$file_dir = dirname($file_path);
$is_readable = true;
$is_writable = is_dir($file_dir);
$is_writable = @is_dir($file_dir);
if (SETUP_DIR_WRITABLE) {
$is_writable = $is_writable && is_writable($file_dir);
$is_writable = $is_writable && @is_writable($file_dir);
}
$file_exists = file_exists($file_path);
if ($file_exists) {
$is_readable = is_readable($file_path);
$is_writable = $is_writable && is_writable($file_path);
$is_writable = $is_writable && @is_writable($file_path);
}
}