diff --git a/application/controllers/system/issues/Plausichecks.php b/application/controllers/system/issues/Plausichecks.php index d72c4f007..daa7716dd 100644 --- a/application/controllers/system/issues/Plausichecks.php +++ b/application/controllers/system/issues/Plausichecks.php @@ -78,7 +78,15 @@ class Plausichecks extends Auth_Controller if (hasData($fehlerRes)) { $fehlerText = getData($fehlerRes)[0]->fehlertext; - $fehlerText = isEmptyArray($fehlertext_params) ? $fehlerText : vsprintf($fehlerText, $fehlertext_params); + + if (!isEmptyArray($fehlertext_params)) + { + if (count($fehlertext_params) != substr_count($fehlerText, '%s')) + $this->terminateWithJsonError('Wrong number of parameters for Fehlertext, fehler_kurzbz ' . $fehler_kurzbz); + + $fehlerText = vsprintf($fehlerText, $fehlertext_params); + } + if (isset($person_id)) $fehlerText .= "; person_id: $person_id"; if (isset($oe_kurzbz)) $fehlerText .= "; oe_kurzbz: $oe_kurzbz"; $issueTexts[$fehler_kurzbz][] = $fehlerText; diff --git a/application/libraries/IssuesLib.php b/application/libraries/IssuesLib.php index 7cc1f964d..9b3a9de6e 100644 --- a/application/libraries/IssuesLib.php +++ b/application/libraries/IssuesLib.php @@ -236,7 +236,15 @@ class IssuesLib if (hasData($fehlerRes)) { $fehlertextVorlage = getData($fehlerRes)[0]->fehlertext; - $fehlertext = isEmptyArray($fehlertext_params) ? $fehlertextVorlage : vsprintf($fehlertextVorlage, $fehlertext_params); + + $fehlertext = $fehlertextVorlage; + if (!isEmptyArray($fehlertext_params)) + { + if (count($fehlertext_params) != substr_count($fehlertextVorlage, '%s')) + return error('Wrong number of parameters for Fehlertext, fehler_kurzbz ' . $fehlercode); + + $fehlertext = vsprintf($fehlertextVorlage, $fehlertext_params); + } $openIssuesCountRes = $this->_ci->IssueModel->getOpenIssueCount($fehlercode, $person_id, $oe_kurzbz, $fehlercode_extern);