phpBB

Code Changes

File: phpbb/event/kernel_exception_subscriber.php

  Unmodified   Added   Modified   Removed
Line 24Line 24
{
/**
* Template object

{
/**
* Template object

 
	*

	* @var \phpbb\template\template
*/
protected $template;

/**

	* @var \phpbb\template\template
*/
protected $template;

/**

	* User object
* @var \phpbb\user


	* Language object
*
* @var \phpbb\language\language

	*/

	*/

	protected $user;

	protected $language;


/** @var \phpbb\request\type_cast_helper */
protected $type_caster;


/** @var \phpbb\request\type_cast_helper */
protected $type_caster;

Line 40Line 42
	/**
* Construct method
*

	/**
* Construct method
*

	* @param \phpbb\template\template $template Template object
* @param \phpbb\user $user User object

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

	*/

	*/

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

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

	{
$this->template = $template;

	{
$this->template = $template;

		$this->user = $user;

		$this->language = $language;

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


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


Line 61Line 63
		$exception = $event->getException();

$message = $exception->getMessage();

		$exception = $event->getException();

$message = $exception->getMessage();

		$this->type_caster->set_var($message, $message, 'string', false, false);

		$this->type_caster->set_var($message, $message, 'string', true, false);


if ($exception instanceof \phpbb\exception\exception_interface)
{


if ($exception instanceof \phpbb\exception\exception_interface)
{

			$message = call_user_func_array(array($this->user, 'lang'), array_merge(array($message), $exception->get_parameters()));

			$message = $this->language->lang_array($message, $exception->get_parameters());

		}

		}

 

// Show <strong> text in bold
$message = preg_replace('#&lt;(/?strong)&gt;#i', '<$1>', $message);


if (!$event->getRequest()->isXmlHttpRequest())
{


if (!$event->getRequest()->isXmlHttpRequest())
{

			page_header($this->user->lang('INFORMATION'));

			page_header($this->language->lang('INFORMATION'));


$this->template->assign_vars(array(


$this->template->assign_vars(array(

				'MESSAGE_TITLE' => $this->user->lang('INFORMATION'),

				'MESSAGE_TITLE' => $this->language->lang('INFORMATION'),

				'MESSAGE_TEXT'  => $message,
));


				'MESSAGE_TEXT'  => $message,
));


Line 111Line 116
		$event->setResponse($response);
}


		$event->setResponse($response);
}


	public static function getSubscribedEvents()

	static public function getSubscribedEvents()

	{
return array(
KernelEvents::EXCEPTION => 'on_kernel_exception',

	{
return array(
KernelEvents::EXCEPTION => 'on_kernel_exception',