ActionController: Don't override `X-Icinga-Title` when it's already set
This commit is contained in:
parent
9225462262
commit
4cff1feb8f
|
@ -496,18 +496,20 @@ class ActionController extends Zend_Controller_Action
|
||||||
$resp->setReloadCss(true);
|
$resp->setReloadCss(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->view->title) {
|
if ($resp->getHeader('X-Icinga-Title') === null) {
|
||||||
if (preg_match('~[\r\n]~', $this->view->title)) {
|
if ($this->view->title) {
|
||||||
// TODO: Innocent exception and error log for hack attempts
|
if (preg_match('~[\r\n]~', $this->view->title)) {
|
||||||
throw new IcingaException('No way, guy');
|
// TODO: Innocent exception and error log for hack attempts
|
||||||
|
throw new IcingaException('No way, guy');
|
||||||
|
}
|
||||||
|
$resp->setHeader(
|
||||||
|
'X-Icinga-Title',
|
||||||
|
rawurlencode($this->view->title . ' :: ' . $this->view->defaultTitle),
|
||||||
|
true
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$resp->setHeader('X-Icinga-Title', rawurlencode($this->view->defaultTitle), true);
|
||||||
}
|
}
|
||||||
$resp->setHeader(
|
|
||||||
'X-Icinga-Title',
|
|
||||||
rawurlencode($this->view->title . ' :: ' . $this->view->defaultTitle),
|
|
||||||
true
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
$resp->setHeader('X-Icinga-Title', rawurlencode($this->view->defaultTitle), true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$layout = $this->_helper->layout();
|
$layout = $this->_helper->layout();
|
||||||
|
|
Loading…
Reference in New Issue