We have moved to Github. Please open tickets there.

Opened 13 months ago

Closed 12 months ago

Last modified 11 months ago

#4447 closed Defect (fixed)

error handler treats type hint violations as notices

Reported by: mrclay Owned by:
Priority: normal Milestone: Elgg 1.8.6
Component: Core Version: 1.8.3
Severity: minor Keywords:
Cc: brett@… Difficulty:

Description

E_RECOVERABLE_ERROR (4096 "Catchable fatal error. It indicates that a probably dangerous error occurred...") was added in PHP5.2 and notably occurs when a type hint is violated by a runtime function call.

These should throw Exceptions, but do not because _elgg_php_error_handler's switch() does not include a case for 4096, so it passes through to be treated as a NOTICE. We can easily support PHP < 5.2 by simply including a case for 4096 instead of the named constant.

Change History (7)

comment:2 Changed 12 months ago by ewinslow

  • Milestone changed from Needs Review to Elgg 1.8.5

comment:3 Changed 12 months ago by Steve Clay

  • Resolution set to fixed
  • Status changed from new to closed

Fixes #4447: Error handler takes type hint violations seriously

Changeset: e3b0662aec78a46357843d0f88e385d488ceba4a

comment:4 Changed 11 months ago by Steve Clay

Fixes #4447: Error handler takes type hint violations seriously

Changeset: e3b0662aec78a46357843d0f88e385d488ceba4a

comment:5 Changed 11 months ago by mrclay

Message from a user: "This added line "case E_RECOVERABLE_ERROR:"
gives me a fatal error in a logged out setup with custom index (my own) ... An unrecoverable error has occurred ...
Could you please tell me, what exactly does this line? I do not get any info about the error, on screen or in the log."
"
I think we want to test the error handling in a PHP 5.2 system right away. I'll try to get the user to give more info.

comment:6 Changed 11 months ago by mrclay

That is, test on PHP 5.1, if that's supported.

comment:7 Changed 11 months ago by cash

No, we don't support PHP 5.1. I think Elgg 1.8 is the first to require PHP 5.2 or greater. I don't think Elgg 1.8 will even install on PHP 5.1.

Note: See TracTickets for help on using tickets.