possibility to use complete string-identifier paths in standard_error and standard_success

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2022-05-01 17:08:22 +02:00
parent 54b467887b
commit 0535420334
2 changed files with 9 additions and 3 deletions

View File

@@ -114,7 +114,10 @@ class Response
$error = '';
foreach ($errors as $single_error) {
$single_error = lng('error.' . $single_error, [htmlentities($replacer)]);
if (strpos($single_error, ".") === false) {
$single_error = 'error.'.$single_error;
}
$single_error = lng($single_error, [htmlentities($replacer)]);
if (empty($error)) {
$error = $single_error;
} else {
@@ -167,7 +170,10 @@ class Response
*/
public static function standardSuccess($success_message = '', $replacer = '', $params = [], $throw_exception = false)
{
$success_message = lng('success.' . $success_message, [htmlentities($replacer)]);
if (strpos($success_message, ".") === false) {
$success_message = 'success.'.$success_message;
}
$success_message = lng($success_message, [htmlentities($replacer)]);
if ($throw_exception) {
throw new Exception(strip_tags($success_message), 200);