Skip to content

fix elseif statement #4444

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Conversation

sdknjg8zxq
Copy link
Contributor

Q A
Doc fix? yes
New docs? no
Applies to all
Fixed tickets --

In this example of the book, the elseif block always evaluates to FALSE since $_SERVER['REQUEST_URI'] includes the query string, therefore if $uri equals to '/index.php/show' then $_GET['id'] is never set, and the list_action() is never executed.

Here I propose a fix by cleaning the query string from the URI before assigning it to $uri, using the built-in function parse_url().

@wouterj
Copy link
Member

wouterj commented Nov 18, 2014

Looks correct to me!

@xabbuh
Copy link
Member

xabbuh commented Nov 18, 2014

Yes, this absolutely makes sense. 👍

@weaverryan
Copy link
Member

Yep, this is much better - thanks Ivan! And happy PR 4444 👯

weaverryan added a commit that referenced this pull request Nov 20, 2014
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #4444).

Discussion
----------

fix elseif statement

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | no
| Applies to    | all
| Fixed tickets | --

In this example of the book, the elseif block always evaluates to FALSE since $_SERVER['REQUEST_URI'] includes the query string, therefore if $uri equals to '/index.php/show' then $_GET['id'] is never set, and the list_action() is never executed.

Here I propose a fix by cleaning the query string from the URI before assigning it to $uri, using the built-in function parse_url().

Commits
-------

ab10529 fix elseif statement
@weaverryan weaverryan closed this Nov 20, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants