mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 20:30:39 +02:00
Fixes #1531 - 404 page has incomplete links
This commit is contained in:
@@ -36,14 +36,33 @@ class core_system_error_controller extends eController
|
|||||||
$template = e107::getCoreTemplate('error', 404);
|
$template = e107::getCoreTemplate('error', 404);
|
||||||
|
|
||||||
$vars = new e_vars(array(
|
$vars = new e_vars(array(
|
||||||
'siteUrl' => SITEURL,
|
'SITEURL' => SITEURL,
|
||||||
'searchUrl' => e107::getUrl()->create('search'),
|
'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);
|
$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
|
* Alias
|
||||||
@@ -63,10 +82,14 @@ class core_system_error_controller extends eController
|
|||||||
$template = e107::getCoreTemplate('error', 403);
|
$template = e107::getCoreTemplate('error', 403);
|
||||||
|
|
||||||
$vars = new e_vars(array(
|
$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);
|
$this->addBody($body);
|
||||||
}
|
}
|
||||||
|
@@ -29,8 +29,8 @@ $ERROR_TEMPLATE['404']['body'] = '
|
|||||||
<p>
|
<p>
|
||||||
'.LAN_ERROR_21.'<br />'.LAN_ERROR_9.'
|
'.LAN_ERROR_21.'<br />'.LAN_ERROR_9.'
|
||||||
</p>
|
</p>
|
||||||
<a href="{siteUrl}">'.LAN_ERROR_20.'</a><br />
|
<a href="{SITEURL}">'.LAN_ERROR_20.'</a><br />
|
||||||
<a href="{searchUrl}">'.LAN_ERROR_22.'</a>
|
<a href="{SEARCHURL}">'.LAN_ERROR_22.'</a>
|
||||||
';
|
';
|
||||||
$ERROR_TEMPLATE['404']['end'] = '</div>';
|
$ERROR_TEMPLATE['404']['end'] = '</div>';
|
||||||
|
|
||||||
@@ -41,7 +41,7 @@ $ERROR_TEMPLATE['403']['body'] = '
|
|||||||
<p>
|
<p>
|
||||||
'.LAN_ERROR_5.'<br />'.LAN_ERROR_6.'<br /><br />'.LAN_ERROR_2.'
|
'.LAN_ERROR_5.'<br />'.LAN_ERROR_6.'<br /><br />'.LAN_ERROR_2.'
|
||||||
</p>
|
</p>
|
||||||
<a href="{siteUrl}">'.LAN_ERROR_20.'</a><br />
|
<a href="{SITEURL}">'.LAN_ERROR_20.'</a><br />
|
||||||
';
|
';
|
||||||
$ERROR_TEMPLATE['403']['end'] = '</div>';
|
$ERROR_TEMPLATE['403']['end'] = '</div>';
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user