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
+25
-17
@@ -11,64 +11,72 @@
|
||||
namespace IPS\Theme;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Template Class
|
||||
*/
|
||||
abstract class _Template
|
||||
abstract class Template
|
||||
{
|
||||
/**
|
||||
* @brief Application key
|
||||
*/
|
||||
public $app = NULL;
|
||||
public ?string $app = NULL;
|
||||
|
||||
/**
|
||||
* @brief Template Location
|
||||
*/
|
||||
public $templateLocation = NULL;
|
||||
public ?string $templateLocation = NULL;
|
||||
|
||||
/**
|
||||
* @brief Template Name
|
||||
*/
|
||||
public $templateName = NULL;
|
||||
public ?string $templateName = NULL;
|
||||
|
||||
/**
|
||||
* Contructor
|
||||
*
|
||||
* @param string $app Application Key
|
||||
* @param string $templateLocation Template location (admin/public/etc.)
|
||||
* @param string $templateName Template Name
|
||||
* @param string $app Application Key
|
||||
* @param string $templateLocation Template location (admin/public/etc.)
|
||||
* @param string $templateName Template Name
|
||||
* @return void
|
||||
*/
|
||||
public function __construct( $app, $templateLocation, $templateName )
|
||||
public function __construct( string $app, string $templateLocation, string $templateName )
|
||||
{
|
||||
$this->app = $app;
|
||||
$this->templateLocation = $templateLocation;
|
||||
$this->templateName = $templateName;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the app/location/group params
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getParams()
|
||||
public function getParams(): array
|
||||
{
|
||||
return array( 'app' => $this->app, 'location' => $this->templateLocation, 'group' => $this->templateName );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Hook Data
|
||||
* htmlspecialchars cannot have string as null, so this wrapper makes it safe to avoid
|
||||
* loads of errors
|
||||
*
|
||||
* @return array
|
||||
* @param string|null $string $string
|
||||
* @param int $flags
|
||||
* @param string|null $encoding
|
||||
* @param bool $double_encode
|
||||
* @return string
|
||||
*/
|
||||
public static function hookData()
|
||||
public static function htmlspecialchars( null|string $string, int $flags = ENT_QUOTES|ENT_SUBSTITUTE, ?string $encoding = null, bool $double_encode = true): string
|
||||
{
|
||||
return array();
|
||||
return htmlspecialchars( $string === null ? '' : $string, $flags, $encoding, $double_encode );
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user