Skip to content
This repository was archived by the owner on Jan 30, 2020. It is now read-only.

Conversation

weierophinney
Copy link
Member

I think those checks on following lines https://github.com/zendframework/zend-http/blob/master/src/PhpEnvironment/Request.php#L498 should use empty() instead of !== null because in some cases it triggers warning on a line:
https://github.com/zendframework/zend-http/blob/master/src/PhpEnvironment/Request.php#L522

@weierophinney
Copy link
Member

Your diagnosis is off. The conditionals in line 498 are correct; what needs to happen is for line 522 to check for a non-empty $baseUrl before the strpos():

if (! empty($baseUrl) && 0 === strpos($requestUri, $baseUrl)) {

I'll work on a test for this shortly.

@weierophinney weierophinney self-assigned this Aug 5, 2015
If the SCRIPT_FILENAME and SCRIPT_NAME are empty, prior to this patch,
an E_WARNING will be raised when we attempt to do a `strpos()` using the
now empty `$baseUrl`. This patch adds a test for that, and also a
conditional prior to the `strpos()` to return early if `$baseUrl` is
empty.
@weierophinney
Copy link
Member

I've converted this issue with a pull request, which adds a test for the condition (it failed prior to the patch), and a patch to ensure the condition does not occur.

@weierophinney weierophinney added this to the 2.5.2 milestone Aug 5, 2015
@weierophinney weierophinney merged commit 17fbfba into zendframework:master Aug 5, 2015
weierophinney added a commit that referenced this pull request Aug 5, 2015
weierophinney added a commit that referenced this pull request Aug 5, 2015
weierophinney added a commit that referenced this pull request Aug 5, 2015
@weierophinney weierophinney deleted the hotfix/14 branch August 5, 2015 15:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant