[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
Mon Jan 12 02:23:45 UTC 2015


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

 * owner:   => jeremyfelt
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"31157"]:
 {{{
 #!CommitTicketReference repository="" revision="31157"
 Check for existence of data from `get_blogaddress_by_id()` before
 returning a URL

 * Prevent a notice when an invalid ID is used with
 `get_blogaddres_by_id()`.
 * Return a falsy empty string rather than the previous "http://".
 * Add unit tests for `get_blogaddress_by_id()`.

 Props nerrad.

 Fixes #30566.
 }}}

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


More information about the wp-trac mailing list