// display image against standard error page for 404 on images
This commit is contained in:
@@ -37,6 +37,16 @@ class PageNotFoundControllerCore extends FrontController
|
|||||||
{
|
{
|
||||||
header('HTTP/1.1 404 Not Found');
|
header('HTTP/1.1 404 Not Found');
|
||||||
header('Status: 404 Not Found');
|
header('Status: 404 Not Found');
|
||||||
|
|
||||||
|
if (in_array(Tools::strtolower(substr($_SERVER['REQUEST_URI'], -3)), array('png', 'jpg', 'gif')))
|
||||||
|
{
|
||||||
|
header('Content-Type: image/gif');
|
||||||
|
readfile(_PS_IMG_DIR_.'img/404.gif');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
elseif (in_array(Tools::strtolower(substr($_SERVER['REQUEST_URI'], -3)), array('.js', 'css')))
|
||||||
|
exit;
|
||||||
|
|
||||||
parent::initContent();
|
parent::initContent();
|
||||||
|
|
||||||
$this->setTemplate(_PS_THEME_DIR_.'404.tpl');
|
$this->setTemplate(_PS_THEME_DIR_.'404.tpl');
|
||||||
|
|||||||
Reference in New Issue
Block a user