get_post() assign by reference fails; should copy instead
|Reported by:||Sam_a||Owned by:||anonymous|
|Severity:||normal||Keywords:||get_post has-patch tested e_notice|
get_post() tries to assign results of the $wpdb post query by reference (wp-includes/post.php#L218) —
$_post = & $wpdb->get_row( […]
— but this fails (with notice "Only variables should be assigned by reference") because $wpdb->get_row() doesn't return a reference.
I think this must be a mistake, because normal assignment would work just as well and doesn't raise an error:
$_post = $wpdb->get_row( […]