Version 5.0.0 beta 1
This commit is contained in:
1 parent
25ddeb65d6
commit
15c7beabc5
6736 files changed
+627902
-497943
No files matched your search
@@ -11,38 +11,43 @@
|
||||
namespace IPS\Email\Outgoing;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
|
||||
use IPS\Member;
|
||||
use RuntimeException;
|
||||
use function defined;
|
||||
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Exception class for email errors
|
||||
*/
|
||||
class _Exception extends \RuntimeException
|
||||
class Exception extends RuntimeException
|
||||
{
|
||||
/**
|
||||
* @brief Extra details for log
|
||||
*/
|
||||
public $extraDetails = array();
|
||||
public $messageKey = NULL;
|
||||
public ?array $extraDetails = array();
|
||||
public ?string $messageKey = NULL;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param string $message Error message
|
||||
* @param int $code Error Code
|
||||
* @param \Exception|NULL $previous Previous Exception
|
||||
* @param array|NULL $extra Extra details for log
|
||||
* @return void
|
||||
* @param string|null $message Error message
|
||||
* @param int $code Error Code
|
||||
* @param Exception|NULL $previous Previous Exception
|
||||
* @param array|null $extra Extra details for log
|
||||
*/
|
||||
public function __construct( $message = null, $code = 0, $previous = null, $extra=NULL )
|
||||
public function __construct( string $message = null, int $code = 0, \Exception|null $previous = null, array $extra=NULL )
|
||||
{
|
||||
/* Store these for the extraLogData() method */
|
||||
$this->extraDetails = $extra;
|
||||
$this->messageKey = $message;
|
||||
$message = \IPS\Member::loggedIn()->language()->addToStack( $message, FALSE, array( 'sprintf' => $extra ) );
|
||||
|
||||
$message = Member::loggedIn()->language()->addToStack( $message, FALSE, array( 'sprintf' => $extra ) );
|
||||
|
||||
return parent::__construct( $message, $code, $previous );
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user