phpBB

Code Changes

File: phpbb/event/kernel_exception_subscriber.php

  Unmodified   Added   Modified   Removed
Line 16Line 16
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;

use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;

 
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;

use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
use Symfony\Component\HttpFoundation\Response;

class kernel_exception_subscriber implements EventSubscriberInterface
{

use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
use Symfony\Component\HttpFoundation\Response;

class kernel_exception_subscriber implements EventSubscriberInterface
{

 
	/**
* Set to true to show full exception messages
*
* @var bool
*/
protected $debug;


	/**
* Template object
*

	/**
* Template object
*

Line 44Line 52
	*
* @param \phpbb\template\template $template Template object
* @param \phpbb\language\language $language Language object

	*
* @param \phpbb\template\template $template Template object
* @param \phpbb\language\language $language Language object

 
	* @param bool						$debug		Set to true to show full exception messages

	*/

	*/

	public function __construct(\phpbb\template\template $template, \phpbb\language\language $language)

	public function __construct(\phpbb\template\template $template, \phpbb\language\language $language, $debug = false)

	{

	{

 
		$this->debug = $debug || defined('DEBUG');

		$this->template = $template;
$this->language = $language;
$this->type_caster = new \phpbb\request\type_cast_helper();

		$this->template = $template;
$this->language = $language;
$this->type_caster = new \phpbb\request\type_cast_helper();

Line 68Line 78
		if ($exception instanceof \phpbb\exception\exception_interface)
{
$message = $this->language->lang_array($message, $exception->get_parameters());

		if ($exception instanceof \phpbb\exception\exception_interface)
{
$message = $this->language->lang_array($message, $exception->get_parameters());

 
		}
else if (!$this->debug && $exception instanceof NotFoundHttpException)
{
$message = $this->language->lang('PAGE_NOT_FOUND');

		}

// Show <strong> text in bold

		}

// Show <strong> text in bold

Line 99Line 113
				$data['message'] = $message;
}


				$data['message'] = $message;
}


			if (defined('DEBUG'))

			if ($this->debug)

			{
$data['trace'] = $exception->getTrace();
}

			{
$data['trace'] = $exception->getTrace();
}