8000 Interpret .php as html request format to show correct error page by alexander-schranz · Pull Request #4013 · sulu/sulu · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Interpret .php as html request format to show correct error page #4013

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

Open
wants to merge 1 commit into
base: 1.6
Choose a base branch
from

Conversation

alexander-schranz
Copy link
Member
Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Fixed tickets fixes #4011
License MIT

What's in this PR?

Interpret .php as html request format to show correct error page.

Why?

Else php will render the symfony standard error page.

Example Usage

/test.php

@alexander-schranz alexander-schranz self-assigned this Jun 8, 2018
@alexander-schranz alexander-schranz added this to the Release 1.6 milestone Jun 8, 2018
@alexander-schranz alexander-schranz force-pushed the bugfix/request-format-php branch from 77bd8f8 to 26dc55a Compare June 8, 2018 07:13
@@ -114,6 +114,10 @@ private function getResourceLocatorFromRequest(PortalInformation $portalInformat
strlen($portalInformation->getUrl())
);

if ('php' === $formatResult) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we fallback to html in general? We have exactly the same problem when people are typing something like /index.asdf.

Copy link
Member Author

Choose a reason for hiding this comment

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

@danrot
@wachterjohannes or @chirimoya said there where usecases where the ending was something like .newsletter so this would make it a little difficult without a bc break doing that.

Copy link
Member Author

Choose a reason for hiding this comment

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

@danrot maybe we should just fix something in the exception controller instead of overwritting the request format behaviour? /cc @sulu/core-team

Copy link
Contributor

Choose a reason for hiding this comment

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

@alexander-schranz Your latest suggestion what we have just discussed with @chirimoya :-) I think we should do it this way. This keeps the old behaviour and fixes the messed up error message for unknown formats.

@alexander-schranz alexander-schranz force-pushed the bugfix/request-format-php branch from 26dc55a to 440e7ee Compare June 13, 2018 14:47
@danrot danrot added the Bug Error or unexpected behavior of already existing functionality label Aug 17, 2018
@niklasnatter niklasnatter changed the base branch from release/1.5 to release/1.6 November 6, 2020 13:46
@alexander-schranz alexander-schranz changed the base branch from release/1.6 to 1.6 January 7, 2021 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Error or unexpected behavior of already existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0