Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[ErrorHandler] Fix error caused byinclude + open_basedir#40242

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nicolas-grekas merged 1 commit intosymfony:5.2fromstlrnz:error-template
Mar 16, 2021

Conversation

@stlrnz
Copy link
Contributor

QA
Branch?5.2
Bug fix?yes
New feature?no
Deprecations?no
Tickets
LicenseMIT
Doc PR

#37492 introduced the option to specify your own error template usingHtmlErrorRenderer::setTemplate('...');

However, the implementation usingfile_exists(...) ininclude can cause an error when not setting a custom template.

php.WARNING: Warning: file_exists(): open_basedir restriction in effect. File(assets/css/error.css) is not within the allowed path(s): (...) {"exception":"[object] (ErrorException(code: 0): Warning: file_exists(): open_basedir restriction in effect. File(assets/css/error.css) is not within the allowed path(s): (...) at ...\vendor\symfony\error-handler\ErrorRenderer\HtmlErrorRenderer.php:355)"} []

As you can see the error is caused by checkingfile_exists(...) using relative paths in environments with a restrictiveopen_basedir policy.

The proposed solution always uses absolute paths to include errors templates (and other files).

@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has acontribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (seehttps://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (seehttps://symfony.com/releases)
  • Features and deprecations must be submitted against the 5.x branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@carsonbotcarsonbot changed the title[ErrorHandler] Fix error caused byincludeFix error caused byincludeFeb 18, 2021
@stlrnzstlrnz changed the titleFix error caused byinclude[ErrorHandler] Fix error caused byincludeFeb 18, 2021
@stlrnzstlrnz changed the title[ErrorHandler] Fix error caused byincludeFix error caused byincludeFeb 18, 2021
@nicolas-grekasnicolas-grekas changed the titleFix error caused byinclude[ErrorHandler] Fix error caused byincludeFeb 18, 2021
@carsonbot
Copy link

Hey!

I see that more good work is coming your way.

I think@awoimbee has recently worked with this code. Maybe they can help review this?

Cheers!

Carsonbot

@nicolas-grekasnicolas-grekas added this to the5.2 milestoneFeb 22, 2021
@nicolas-grekasnicolas-grekas changed the title[ErrorHandler] Fix error caused byinclude[ErrorHandler] Fix error caused byinclude + open_basedirMar 16, 2021
Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

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

(I updated the implementation)

@nicolas-grekas
Copy link
Member

Thank you@stlrnz.

@nicolas-grekasnicolas-grekas merged commit8113f10 intosymfony:5.2Mar 16, 2021
@fabpotfabpot mentioned this pull requestMar 29, 2021
@PhilETaylor
Copy link
Contributor

Only just seen this. Sorry that my implementation of#37492 caused issued, and thank you for fixing it :)

xabbuh reacted with thumbs up emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@ycerutoycerutoAwaiting requested review from ycerutoyceruto is a code owner

@chalasrchalasrAwaiting requested review from chalasr

@dunglasdunglasAwaiting requested review from dunglas

@jderussejderusseAwaiting requested review from jderusse

@lyrixxlyrixxAwaiting requested review from lyrixx

@OskarStarkOskarStarkAwaiting requested review from OskarStark

@srozesrozeAwaiting requested review from sroze

@wouterjwouterjAwaiting requested review from wouterj

@xabbuhxabbuhAwaiting requested review from xabbuh

Assignees

No one assigned

Projects

None yet

Milestone

5.2

Development

Successfully merging this pull request may close these issues.

4 participants

@stlrnz@carsonbot@nicolas-grekas@PhilETaylor

[8]ページ先頭

©2009-2025 Movatter.jp