diff options
Diffstat (limited to 'modules/node')
-rw-r--r-- | modules/node/node.module | 6 | ||||
-rw-r--r-- | modules/node/node.pages.inc | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/modules/node/node.module b/modules/node/node.module index 77c2c875e..54160f8a3 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -707,7 +707,7 @@ function node_load($param = array(), $revision = NULL, $reset = NULL) { if ($cachable) { // Is the node statically cached? if (isset($nodes[$param])) { - return is_object($nodes[$param]) ? drupal_clone($nodes[$param]) : $nodes[$param]; + return is_object($nodes[$param]) ? clone $nodes[$param] : $nodes[$param]; } } $cond = 'n.nid = %d'; @@ -764,7 +764,7 @@ function node_load($param = array(), $revision = NULL, $reset = NULL) { } } if ($cachable) { - $nodes[$node->nid] = is_object($node) ? drupal_clone($node) : $node; + $nodes[$node->nid] = is_object($node) ? clone $node : $node; } } @@ -2724,7 +2724,7 @@ function node_unpublish_by_keyword_action_submit($form, $form_state) { */ function node_unpublish_by_keyword_action($node, $context) { foreach ($context['keywords'] as $keyword) { - if (strstr(node_view(drupal_clone($node)), $keyword) || strstr($node->title, $keyword)) { + if (strstr(node_view(clone $node), $keyword) || strstr($node->title, $keyword)) { $node->status = 0; watchdog('action', 'Set @type %title to unpublished.', array('@type' => node_get_types('name', $node), '%title' => $node->title)); break; diff --git a/modules/node/node.pages.inc b/modules/node/node.pages.inc index aef2308c7..dc3e529cb 100644 --- a/modules/node/node.pages.inc +++ b/modules/node/node.pages.inc @@ -394,7 +394,7 @@ function node_preview($node) { // Display a preview of the node. // Previewing alters $node so it needs to be cloned. if (!form_get_errors()) { - $cloned_node = drupal_clone($node); + $cloned_node = clone $node; $cloned_node->build_mode = NODE_BUILD_PREVIEW; $output = theme('node_preview', $cloned_node); } @@ -432,7 +432,7 @@ function theme_node_preview($node) { if ($preview_trimmed_version) { drupal_set_message(t('The trimmed version of your post shows what your post looks like when promoted to the main page or when exported for syndication.<span class="no-js"> You can insert the delimiter "<!--break-->" (without the quotes) to fine-tune where your post gets split.</span>')); $output .= '<h3>'. t('Preview trimmed version') .'</h3>'; - $output .= node_view(drupal_clone($node), 1, FALSE, 0); + $output .= node_view(clone $node, 1, FALSE, 0); $output .= '<h3>'. t('Preview full version') .'</h3>'; $output .= node_view($node, 0, FALSE, 0); } |