Ticket #16813: 16813.patch
File 16813.patch, 3.2 KB (added by , 14 years ago) |
---|
-
wp-includes/cache.php
350 350 if ( isset ($this->cache[$group][$id]) ) { 351 351 $this->cache_hits += 1; 352 352 if ( is_object($this->cache[$group][$id]) ) 353 return wp_clone($this->cache[$group][$id]);353 return clone $this->cache[$group][$id]; 354 354 else 355 355 return $this->cache[$group][$id]; 356 356 } … … 426 426 $data = ''; 427 427 428 428 if ( is_object($data) ) 429 $data = wp_clone($data);429 $data = clone $data; 430 430 431 431 $this->cache[$group][$id] = $data; 432 432 -
wp-includes/comment.php
1394 1394 return false; 1395 1395 } 1396 1396 1397 $comment_old = wp_clone(get_comment($comment_id));1397 $comment_old = clone get_comment($comment_id); 1398 1398 1399 1399 if ( !$wpdb->update( $wpdb->comments, array('comment_approved' => $status), array('comment_ID' => $comment_id) ) ) { 1400 1400 if ( $wp_error ) -
wp-includes/deprecated.php
2602 2602 return true; 2603 2603 } 2604 2604 2605 2606 /** 2607 * Copy an object. 2608 * 2609 * Returns a cloned copy of an object. 2610 * 2611 * @since 2.7.0 2612 * @deprecated 3.2 2613 * 2614 * @param object $object The object to clone 2615 * @return object The cloned object 2616 */ 2617 function wp_clone( $object ) { 2618 _deprecated_function( __FUNCTION__, '3.2' ); 2619 2620 return clone $object; 2621 } 2622 No newline at end of file -
wp-includes/functions.php
509 509 wp_protect_special_option( $option ); 510 510 511 511 if ( is_object($newvalue) ) 512 $newvalue = wp_clone($newvalue);512 $newvalue = clone $newvalue; 513 513 514 514 $newvalue = sanitize_option( $option, $newvalue ); 515 515 $oldvalue = get_option( $option ); … … 590 590 591 591 wp_protect_special_option( $option ); 592 592 593 /* 594 * FIXME the next two lines of code are not necessary and should be removed. 595 * @see http://core.trac.wordpress.org/ticket/13480 596 */ 593 597 if ( is_object($value) ) 594 $value = wp_clone($value);598 $value = clone $value; 595 599 596 600 $value = sanitize_option( $option, $value ); 597 601 -
wp-includes/load.php
552 552 } 553 553 554 554 /** 555 * Copy an object.556 *557 * Returns a cloned copy of an object.558 *559 * @since 2.7.0560 *561 * @param object $object The object to clone562 * @return object The cloned object563 */564 function wp_clone( $object ) {565 static $can_clone;566 if ( !isset( $can_clone ) )567 $can_clone = version_compare( phpversion(), '5.0', '>=' );568 569 return $can_clone ? clone( $object ) : $object;570 }571 572 /**573 555 * Whether the current request is for a network or blog admin page 574 556 * 575 557 * Does not inform on whether the user is an admin! Use capability checks to