Opened 8 years ago
Closed 8 years ago
#37615 closed defect (bug) (fixed)
Do not pass `$site` and `$network` by reference in `get_*()` functions
Reported by: | flixos90 | Owned by: | jeremyfelt |
---|---|---|---|
Milestone: | 4.6 | Priority: | normal |
Severity: | normal | Version: | 4.6 |
Component: | Networks and Sites | Keywords: | has-patch |
Focuses: | multisite | Cc: |
Description
In get_site()
, the $site
parameter is passed by reference, which doesn't make a lot of sense. Same for the $network
parameter in get_network()
. Objects are passed by reference anyway, but passing for example the ID by reference could possibly lead to unexpected results.
Attachments (2)
Change History (7)
#2
@
8 years ago
- Owner set to jeremyfelt
- Status changed from new to accepted
Looks good. I don't think there's a reason for us to pass by reference here. I'm going to hold off on committing to trunk until we're good for 4.6 as well. Pinging @ocean90 for review. :)
This ticket was mentioned in Slack in #core-multisite by ocean90. View the logs.
8 years ago
Note: See
TracTickets for help on using
tickets.
37615.diff adjust that. The patch also adjust a similar issue in
update_site_cache()
, and fixes the docs for the$network
parameter ofget_network()
(previously didn't mention the default value).