Skip to content

Undefined index REMOTE_ADDR#23

Merged
mbabker merged 1 commit intojoomla-framework:masterfrom
SharkyKZ:remoteAddr
Jul 11, 2019
Merged

Undefined index REMOTE_ADDR#23
mbabker merged 1 commit intojoomla-framework:masterfrom
SharkyKZ:remoteAddr

Conversation

@SharkyKZ
Copy link
Copy Markdown
Contributor

Pull Request for Issue #

Summary of Changes

Check that $_SERVER['REMOTE_ADDR'] is set.

Testing Instructions

Use IpHelper::workaroundIPIssues() or IpHelper::getIp in CLI.

Expected Result

No notices.

Actual Result

Notice: Undefined index: REMOTE_ADDR in libraries\vendor\joomla\utilities\src\IpHelper.php on line 390
Notice: Undefined index: REMOTE_ADDR in libraries\vendor\joomla\utilities\src\IpHelper.php on line 488

Documentation Changes Required

No.

@SharkyKZ
Copy link
Copy Markdown
Contributor Author

Is there something other than an empty string we should return when running in CLI?

@mbabker
Copy link
Copy Markdown
Contributor

mbabker commented Jul 11, 2019

There is no IP for a CLI process. Trying to fake it is inconsistent with PHP.

@mbabker mbabker merged commit bdd107c into joomla-framework:master Jul 11, 2019
@SharkyKZ SharkyKZ deleted the remoteAddr branch July 11, 2019 14:03
@SharkyKZ
Copy link
Copy Markdown
Contributor Author

OK, thanks.

@richard67
Copy link
Copy Markdown
Contributor

@mbabker It seems the changes in this PR have not been merged up to the 2.0-dev branch yet.

nibra added a commit that referenced this pull request Aug 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants