From a0f1a1c89bb64bf1f620f8b6118e0c1be7cd5407 Mon Sep 17 00:00:00 2001
From: Ryan Boren <ryan@git.wordpress.org>
Date: Wed, 6 May 2009 05:03:59 +0000
Subject: [PATCH] Return ref. Props nbachiyski. fixes #9109

git-svn-id: https://develop.svn.wordpress.org/trunk@11216 602fd350-edb4-49c9-b593-d223f7449a82
---
 wp-includes/taxonomy.php | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php
index d9030f03b7..989e367587 100644
--- a/wp-includes/taxonomy.php
+++ b/wp-includes/taxonomy.php
@@ -612,8 +612,10 @@ function &get_terms($taxonomies, $args = '') {
 	}
 
 	foreach ( (array) $taxonomies as $taxonomy ) {
-		if ( ! is_taxonomy($taxonomy) )
-			return new WP_Error('invalid_taxonomy', __('Invalid Taxonomy'));
+		if ( ! is_taxonomy($taxonomy) ) {
+			$error = & new WP_Error('invalid_taxonomy', __('Invalid Taxonomy'));
+			return $error;
+		}
 	}
 
 	$in_taxonomies = "'" . implode("', '", $taxonomies) . "'";