summaryrefslogtreecommitdiff
path: root/modules/upload/upload.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2007-01-31 15:49:26 +0000
committerDries Buytaert <dries@buytaert.net>2007-01-31 15:49:26 +0000
commit05a708fb06137758cf7a15a623b4813af2fc005f (patch)
tree6ae6f50edbcb601329805cbbd7c22d11340327e3 /modules/upload/upload.module
parent4c9fc80fc48608982a731b03655b02e5ccdb6b17 (diff)
downloadbrdo-05a708fb06137758cf7a15a623b4813af2fc005f.tar.gz
brdo-05a708fb06137758cf7a15a623b4813af2fc005f.tar.bz2
- Patch #112715 by chx, webchick, asimmonds, et al: fixing E_ALL notices. Thanks.
Diffstat (limited to 'modules/upload/upload.module')
-rw-r--r--modules/upload/upload.module10
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/upload/upload.module b/modules/upload/upload.module
index 5fec76209..c85df433c 100644
--- a/modules/upload/upload.module
+++ b/modules/upload/upload.module
@@ -285,7 +285,7 @@ function _upload_prepare(&$node) {
// Clean up old file previews if a post didn't get the user to this page.
// i.e. the user left the edit page, because they didn't want to upload anything.
if(count($_POST) == 0) {
- if (is_array($_SESSION['file_previews']) && count($_SESSION['file_previews'])) {
+ if (!empty($_SESSION['file_previews']) && is_array($_SESSION['file_previews'])) {
foreach ($_SESSION['file_previews'] as $fid => $file) {
file_delete($file->filepath);
}
@@ -321,7 +321,7 @@ function _upload_prepare(&$node) {
}
// Attach file previews to node object.
- if (is_array($_SESSION['file_previews']) && count($_SESSION['file_previews'])) {
+ if (!empty($_SESSION['file_previews']) && is_array($_SESSION['file_previews'])) {
foreach ($_SESSION['file_previews'] as $fid => $file) {
if ($user->uid != 1) {
// Here something.php.pps becomes something.php_.pps
@@ -395,7 +395,7 @@ function _upload_validate(&$node) {
$filesize = 0;
// Check if node->files exists, and if it contains something.
- if (is_array($node->files)) {
+ if (isset($node->files) && is_array($node->files)) {
// Update existing files with form data.
foreach ($node->files as $fid => $file) {
// Convert file to object for compatibility
@@ -762,7 +762,7 @@ function _upload_form($node) {
$form['#theme'] = 'upload_form_new';
- if (is_array($node->files) && count($node->files)) {
+ if (!empty($node->files) && is_array($node->files)) {
$form['files']['#theme'] = 'upload_form_current';
$form['files']['#tree'] = TRUE;
foreach ($node->files as $key => $file) {
@@ -799,7 +799,7 @@ function _upload_form($node) {
}
// Needed for JS
- $form['current']['vid'] = array('#type' => 'hidden', '#value' => $node->vid);
+ $form['current']['vid'] = array('#type' => 'hidden', '#value' => isset($node->vid) ? $node->vid : 0);
return $form;
}