Opened 12 years ago
Closed 12 years ago
#2750 closed defect (bug) (fixed)
Unit tests output notices from bbp_current_author_ip()
| Reported by: | johnjamesjacoby | Owned by: | johnjamesjacoby |
|---|---|---|---|
| Priority: | normal | Milestone: | 2.6 |
| Component: | General | Version: | 2.1 |
| Severity: | normal | Keywords: | |
| Cc: |
Description
Starting to setup PHPUnit, I'm getting notices from bbp_current_author_ip() because of our direct and unchecked use of $_SERVER['REMOTE_ADDR']
PHP Notice: Undefined index: REMOTE_ADDR in /includes/users/functions.php on line 146
Change History (2)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
This can safely be fixed with an
empty()check to start. In the event there's noREMOTE_ADDRI propose we force the IP address to '0.0.0.0' so at least there's an indication something strange occurred.