- #10342: PHP5 fix with undefined array.

4.5.x
Steven Wittens 2004-08-25 16:41:30 +00:00
parent 674e2f493b
commit cdb6aa723b
2 changed files with 16 additions and 4 deletions

View File

@ -1127,6 +1127,7 @@ function node_form($edit) {
// Get the node-specific bits.
// We can't use node_invoke() because $param must be passed by reference.
$function = node_get_module_name($edit) .'_form';
$param = array();
if (function_exists($function)) {
$form .= $function($edit, $param);
}
@ -1139,7 +1140,7 @@ function node_form($edit) {
// Add hidden 'op' variable, which specifies the default operation (Preview).
$output .= '<input type="hidden" name="op" value="'. check_form(t('Preview')) ."\" />\n";
// Add the admin-specific parts/
// Add the admin-specific parts.
if (user_access('administer nodes')) {
$output .= '<div class="admin">';
@ -1218,7 +1219,12 @@ function node_form($edit) {
$extra = node_invoke_nodeapi($edit, 'form param');
foreach ($extra as $key => $value) {
if (is_array($value)) {
$param[$key] = array_merge($param[$key], $value);
if (isset($param[$key])) {
$param[$key] = array_merge($param[$key], $value);
}
else {
$param[$key] = $value;
}
}
else {
$param[$key] = $value;

View File

@ -1127,6 +1127,7 @@ function node_form($edit) {
// Get the node-specific bits.
// We can't use node_invoke() because $param must be passed by reference.
$function = node_get_module_name($edit) .'_form';
$param = array();
if (function_exists($function)) {
$form .= $function($edit, $param);
}
@ -1139,7 +1140,7 @@ function node_form($edit) {
// Add hidden 'op' variable, which specifies the default operation (Preview).
$output .= '<input type="hidden" name="op" value="'. check_form(t('Preview')) ."\" />\n";
// Add the admin-specific parts/
// Add the admin-specific parts.
if (user_access('administer nodes')) {
$output .= '<div class="admin">';
@ -1218,7 +1219,12 @@ function node_form($edit) {
$extra = node_invoke_nodeapi($edit, 'form param');
foreach ($extra as $key => $value) {
if (is_array($value)) {
$param[$key] = array_merge($param[$key], $value);
if (isset($param[$key])) {
$param[$key] = array_merge($param[$key], $value);
}
else {
$param[$key] = $value;
}
}
else {
$param[$key] = $value;