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

Fix errors/html/error_exception.php #4128

Merged
merged 4 commits into from
Jan 21, 2021

Conversation

kenjis
Copy link
Member

@kenjis kenjis commented Jan 18, 2021

Description
errors/html/error_exception.php throws error when constants contain resource and can't see the real exception.

ErrorException #1

Uncaught ErrorException: htmlspecialchars() expects parameter 1 to be string, resource given in .../app/Views/errors/html/error_exception.php:182 Stack trace: #0 [internal function]: CodeIgniter\Debug\Exceptions->errorHandler(2, 'htmlspecialchar...', '/Users/kenji/wo...', 182, Array) #1 .../app/Views/errors/html/error_exception.php(182): htmlspecialchars(Resource id #4, 8, 'UTF-8') #2 .../vendor/codeigniter4/codeigniter4/system/Debug/Exceptions.php(281): include('/Users/kenji/wo...') #3 .../vendor/codeigniter4/codeigniter4/system/Debug/Exceptions.php(147): CodeIgniter\Debug\Exceptions->render(Object(...\Exception\NotSupportedException), 500) #4 [internal function]: CodeIgniter\Debug\Exceptions->exceptionHandler(Object(...\Exception\NotSupportedException)) #5 {main} thrown 

Checklist:

  • Securely signed commits
  • Component(s) with PHPdocs
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@kenjis
Copy link
Member Author

kenjis commented Jan 19, 2021

@samsonasik @paulbalandan
Fixed:

  • use is_string($value) in all places
  • add </pre>
  • escape print_r() output

@samsonasik samsonasik merged commit deb5fc2 into codeigniter4:develop Jan 21, 2021
@samsonasik
Copy link
Member

@kenjis thank you for the PR.
@paulbalandan thank you for the review.

@kenjis kenjis deleted the fix-error_exception branch January 24, 2021 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants