Commit ede1f0b9 authored by Aaron Wells's avatar Aaron Wells Committed by Robert Lyon
Browse files

PHP7 changes the type required for exception handler

Bug 1575969. In PHP7 some errors throw an Error object (to
the exception handler) instead of generating an error
(handled by the error handler). The official way to make
an exception handler that will work in PHP 5 & 7, is to
leave off the parameter's type declaration.

Change-Id: I5fc1c3765d5a311eb499d62915e676f8d9ee07a0
behatnotneeded: Covered by existing tests
(cherry picked from commit c3d7f4f6)
parent 2a30b1ce
......@@ -494,10 +494,11 @@ function error ($code, $message, $file, $line, $vars) {
* situations. After this is called the script will end, so make sure to catch
* any exceptions that you can deal with.
* @param Exception $e The exception that was thrown.
* @param Throwable $e The exception that was thrown. (For PHP 5 & 7 cross-compatibility,
* this parameter must have no type declaration.)
* @access private
function exception (Exception $e) {
function exception ($e) {
global $USER;
if ($USER) {
if (!($e instanceof MaharaException) || get_class($e) == 'MaharaException') {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment