Custom block: check if constants are defined and if files actually exist
This commit is contained in:
parent
2de4d97a2d
commit
614bcdd887
16
index.php
16
index.php
@ -70,19 +70,23 @@ if (isset($_SESSION[LookingGlass::SESSION_ERROR_MESSAGE])) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (LG_BLOCK_CUSTOM) {
|
if (LG_BLOCK_CUSTOM) {
|
||||||
include LG_CUSTOM_PHP;
|
if (defined('LG_CUSTOM_PHP') && file_exists(LG_CUSTOM_PHP)) {
|
||||||
|
include LG_CUSTOM_PHP;
|
||||||
|
}
|
||||||
|
|
||||||
ob_start();
|
if (defined('LG_CUSTOM_HTML') && file_exists(LG_CUSTOM_HTML)) {
|
||||||
include LG_CUSTOM_HTML;
|
ob_start();
|
||||||
$templateData['custom_html'] = ob_get_clean();
|
include LG_CUSTOM_HTML;
|
||||||
|
$templateData['custom_html'] = ob_get_clean();
|
||||||
|
}
|
||||||
|
|
||||||
if (defined('LG_CUSTOM_HEADER_PHP')) {
|
if (defined('LG_CUSTOM_HEADER_PHP') && file_exists(LG_CUSTOM_HEADER_PHP)) {
|
||||||
ob_start();
|
ob_start();
|
||||||
include LG_CUSTOM_HEADER_PHP;
|
include LG_CUSTOM_HEADER_PHP;
|
||||||
$templateData['custom_header'] = ob_get_clean();
|
$templateData['custom_header'] = ob_get_clean();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (defined('LG_CUSTOM_FOOTER_PHP')) {
|
if (defined('LG_CUSTOM_FOOTER_PHP') && file_exists(LG_CUSTOM_FOOTER_PHP)) {
|
||||||
ob_start();
|
ob_start();
|
||||||
include LG_CUSTOM_FOOTER_PHP;
|
include LG_CUSTOM_FOOTER_PHP;
|
||||||
$templateData['custom_footer'] = ob_get_clean();
|
$templateData['custom_footer'] = ob_get_clean();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user