mirror of
https://github.com/e107inc/e107.git
synced 2025-06-03 17:34:59 +02:00
Fixes #1531 - 404 page has incomplete links
This commit is contained in:
parent
ae85b7b4d1
commit
8de008860d
@ -36,14 +36,33 @@ class core_system_error_controller extends eController
|
||||
$template = e107::getCoreTemplate('error', 404);
|
||||
|
||||
$vars = new e_vars(array(
|
||||
'siteUrl' => SITEURL,
|
||||
'searchUrl' => e107::getUrl()->create('search'),
|
||||
'SITEURL' => SITEURL,
|
||||
'SEARCHURL' => e107::getUrl()->create('search'),
|
||||
));
|
||||
|
||||
$body = e107::getParser()->parseTemplate($template['start'].$template['body'].$template['end'], true, null, $vars);
|
||||
|
||||
|
||||
$body = e107::getParser()->parseTemplate(
|
||||
$this->updateTemplate($template['start']).
|
||||
$this->updateTemplate($template['body']).
|
||||
$this->updateTemplate($template['end'])
|
||||
, true, null, $vars);
|
||||
|
||||
$this->addBody($body);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update template to v2.x spec. ALL CAPS shortcodes only.
|
||||
* @param $template
|
||||
* @return mixed
|
||||
*/
|
||||
private function updateTemplate($template)
|
||||
{
|
||||
$srch = array('{siteUrl}','{searchUrl}');
|
||||
$repl = array('{SITEURL}','{SEARCHURL}');
|
||||
|
||||
return str_replace($srch,$repl,$template);
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias
|
||||
@ -63,10 +82,14 @@ class core_system_error_controller extends eController
|
||||
$template = e107::getCoreTemplate('error', 403);
|
||||
|
||||
$vars = new e_vars(array(
|
||||
'siteUrl' => SITEURL,
|
||||
'SITEURL' => SITEURL,
|
||||
));
|
||||
|
||||
$body = e107::getParser()->parseTemplate($template['start'].$template['body'].$template['end'], true, null, $vars);
|
||||
$body = e107::getParser()->parseTemplate(
|
||||
$this->updateTemplate($template['start']).
|
||||
$this->updateTemplate($template['body']).
|
||||
$this->updateTemplate($template['end'])
|
||||
, true, null, $vars);
|
||||
|
||||
$this->addBody($body);
|
||||
}
|
||||
|
@ -29,8 +29,8 @@ $ERROR_TEMPLATE['404']['body'] = '
|
||||
<p>
|
||||
'.LAN_ERROR_21.'<br />'.LAN_ERROR_9.'
|
||||
</p>
|
||||
<a href="{siteUrl}">'.LAN_ERROR_20.'</a><br />
|
||||
<a href="{searchUrl}">'.LAN_ERROR_22.'</a>
|
||||
<a href="{SITEURL}">'.LAN_ERROR_20.'</a><br />
|
||||
<a href="{SEARCHURL}">'.LAN_ERROR_22.'</a>
|
||||
';
|
||||
$ERROR_TEMPLATE['404']['end'] = '</div>';
|
||||
|
||||
@ -41,7 +41,7 @@ $ERROR_TEMPLATE['403']['body'] = '
|
||||
<p>
|
||||
'.LAN_ERROR_5.'<br />'.LAN_ERROR_6.'<br /><br />'.LAN_ERROR_2.'
|
||||
</p>
|
||||
<a href="{siteUrl}">'.LAN_ERROR_20.'</a><br />
|
||||
<a href="{SITEURL}">'.LAN_ERROR_20.'</a><br />
|
||||
';
|
||||
$ERROR_TEMPLATE['403']['end'] = '</div>';
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user