Files
FreshRSS/lib/Minz/Helper.php
T
Inverle 0addf32b36 Translate non-English code comments and identifiers (#9383)
Note: The changes in this PR are entirely AI-authored but manually reviewed and tested

## Summary

Translate the remaining French prose and French-derived identifiers in the main FreshRSS/Minz codebase to English.

Why: helps to understand the code

## Scope

- Minz comments, PHPDoc, and paginator identifiers
- Application comments and related identifiers
- Installer database identifiers
- Theme metadata descriptions and the identified CSS comments, previous discussion: https://github.com/FreshRSS/FreshRSS/pull/8241#discussion_r2553181653
- Related call sites and view helpers

External libraries and intentional i18n/docs content are excluded.
2026-10-20 09:52:31 +02:00

34 lines
795 B
PHP

<?php
declare(strict_types=1);
/**
* MINZ - Copyright 2011 Marien Fressinaud
* Licensed under AGPL3 <https://www.gnu.org/licenses/>
*/
/**
* The Minz_Helper class contains some misc. help functions
*/
final class Minz_Helper {
/**
* Wrapper for htmlspecialchars.
* Force UTF-8 value and can be used on array too.
*
* @phpstan-template T of mixed
* @phpstan-param T $var
* @phpstan-return T
*/
public static function htmlspecialchars_utf8(mixed $var, int $flags = ENT_COMPAT): mixed {
if (is_array($var)) {
// @phpstan-ignore return.type
return array_map(fn($v) => self::htmlspecialchars_utf8($v, $flags), $var);
} elseif (is_string($var)) {
// @phpstan-ignore return.type
return htmlspecialchars($var, $flags, 'UTF-8');
} else {
return $var;
}
}
}