Skip to content
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

Prevent an infinite loop in sendErrorPage() #14108

Merged
merged 3 commits into from Oct 15, 2018
Merged

Conversation

JoshuaLuckers
Copy link
Contributor

What does it do?

It makes it possible to skip the sendErrorPage if the resource does not exist.

Why is it needed?

To prevent an infinite loop if the defined error_page in system settings is a non-existent resource.

Related issue(s)/PR(s)

#14107

@Jako Jako added this to the v2.7.0 milestone Oct 10, 2018
@Jako Jako added bug The issue in the code or project, which should be addressed. area-core pr/review-needed Pull request requires review and testing. labels Oct 10, 2018
Copy link
Collaborator

@Jako Jako left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

elseif instead of else if

@jonleverrier
Copy link
Contributor

I've tested this PR @JoshuaLuckers.

When the error_page is set to an ID that doesn't exist, it returns a 404 (page not found). It no longer produces an error 500 / timeout.

Just to confirm, it doesn't redirect to start_id.

@Jako
Copy link
Collaborator

Jako commented Oct 13, 2018

I'll check this today #modxbughunt

@Jako
Copy link
Collaborator

Jako commented Oct 13, 2018

Checked, works fine. Thanks!

@Jako Jako added pr/ready-for-merging Pull request reviewed and tested and ready for merging. and removed pr/review-needed Pull request requires review and testing. labels Oct 13, 2018
@Jako Jako merged commit e38864e into modxcms:2.x Oct 15, 2018
Jako added a commit that referenced this pull request Oct 15, 2018
Merge remote-tracking branch 'upstream/pr/14108' into 2.x

* upstream/pr/14108:
  Documentation for the new parameter
  All control keywords should look like single words
  If the defined error_page is a non-existent resource we don't want it to redirect in an infinite loop
@JoshuaLuckers JoshuaLuckers deleted the issue-14107 branch January 1, 2019 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core bug The issue in the code or project, which should be addressed. pr/ready-for-merging Pull request reviewed and tested and ready for merging.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants