Opened 10 years ago
Closed 10 years ago
#37615 closed defect (bug) (fixed)
Do not pass `$site` and `$network` by reference in `get_*()` functions
| Reported by: | flixos90 | Owned by: | jeremyfelt |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.6 |
| Component: | Networks and Sites | Version: | 4.6 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: | multisite |
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
@
10 years ago
- Owner set to
- Status new → 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.
10 years ago
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
37615.diff adjust that. The patch also adjust a similar issue in
update_site_cache(), and fixes the docs for the$networkparameter ofget_network()(previously didn't mention the default value).