[wp-trac] [WordPress Trac] #30566: Fix "Trying to get property of non-object" notice when calling get_blogaddress_by_id() with an invalid id.

WordPress Trac noreply at wordpress.org
Tue Dec 2 22:34:33 UTC 2014


#30566: Fix "Trying to get property of non-object" notice when calling
get_blogaddress_by_id() with an invalid id.
--------------------------------+-----------------------------
 Reporter:  nerrad              |       Owner:
     Type:  defect (bug)        |      Status:  new
 Priority:  normal              |   Milestone:  Future Release
Component:  Networks and Sites  |     Version:  trunk
 Severity:  normal              |  Resolution:
 Keywords:  has-patch           |     Focuses:  multisite
--------------------------------+-----------------------------

Comment (by nerrad):

 I returned an empty string because in the original `http://` is a string.
 In my opinion returning the same data type is better and since the caller
 is expectation a string to be returned...

 Splitting the unit test in two works, and yeah you're right about the unit
 tests not needing new sites.  I'll implement.

 I don't like `http://` being hardcoded either, maybe this would be a good
 opportunity to use something like `set_url_scheme()` to setup the url
 correctly?  I imagine the function as is is prone to bugs when used on
 multisite installs that are `https://` only.

 Yeah and future release (4.2) is fine for me, I know we're late in the
 current dev cycle.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/30566#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list