Commit 7c05eaa9 authored by drumm's avatar drumm

#66662 by stefan nagtegaal, Remove PHP notices

parent 24d04502
......@@ -45,7 +45,7 @@ function upload_link($type, $node = 0, $main = 0) {
$links = array();
// Display a link with the number of attachments
if ($main && $type == 'node' && is_array($node->files) && user_access('view uploaded files')) {
if ($main && $type == 'node' && isset($node->files) && user_access('view uploaded files')) {
$num_files = 0;
foreach ($node->files as $file) {
if ($file->list) {
......@@ -81,7 +81,7 @@ function upload_menu($may_cache) {
}
else {
// Add handlers for previewing new uploads.
if ($_SESSION['file_previews']) {
if (isset($_SESSION['file_previews'])) {
foreach ($_SESSION['file_previews'] as $fid => $file) {
$filename = file_create_filename($file->filename, file_create_path());
if (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PRIVATE) {
......@@ -405,8 +405,8 @@ function upload_nodeapi(&$node, $op, $teaser) {
case 'load':
if (variable_get("upload_$node->type", 1) == 1) {
$output['files'] = upload_load($node);
return $output;
}
return $output;
break;
case 'prepare':
......@@ -418,7 +418,7 @@ function upload_nodeapi(&$node, $op, $teaser) {
break;
case 'view':
if (is_array($node->files) && user_access('view uploaded files')) {
if (isset($node->files) && user_access('view uploaded files')) {
// Manipulate so that inline references work in preview
if (!variable_get('clean_url', 0)) {
$previews = array();
......
......@@ -45,7 +45,7 @@ function upload_link($type, $node = 0, $main = 0) {
$links = array();
// Display a link with the number of attachments
if ($main && $type == 'node' && is_array($node->files) && user_access('view uploaded files')) {
if ($main && $type == 'node' && isset($node->files) && user_access('view uploaded files')) {
$num_files = 0;
foreach ($node->files as $file) {
if ($file->list) {
......@@ -81,7 +81,7 @@ function upload_menu($may_cache) {
}
else {
// Add handlers for previewing new uploads.
if ($_SESSION['file_previews']) {
if (isset($_SESSION['file_previews'])) {
foreach ($_SESSION['file_previews'] as $fid => $file) {
$filename = file_create_filename($file->filename, file_create_path());
if (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PRIVATE) {
......@@ -405,8 +405,8 @@ function upload_nodeapi(&$node, $op, $teaser) {
case 'load':
if (variable_get("upload_$node->type", 1) == 1) {
$output['files'] = upload_load($node);
return $output;
}
return $output;
break;
case 'prepare':
......@@ -418,7 +418,7 @@ function upload_nodeapi(&$node, $op, $teaser) {
break;
case 'view':
if (is_array($node->files) && user_access('view uploaded files')) {
if (isset($node->files) && user_access('view uploaded files')) {
// Manipulate so that inline references work in preview
if (!variable_get('clean_url', 0)) {
$previews = array();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment