Files
sam-kd/DBcontrol/libraries/classes/Twig/SanitizeExtension.php
hskwon aca1767eb9 초기 커밋: 5130 레거시 시스템
- URL 하드코딩 → .env APP_URL 기반 동적 URL로 변경
- DB 연결 하드코딩 → .env 기반으로 변경
- MySQL strict mode DATE 오류 수정
2025-12-10 20:14:31 +09:00

55 lines
1.2 KiB
PHP

<?php
declare(strict_types=1);
namespace PhpMyAdmin\Twig;
use Twig\Extension\AbstractExtension;
use Twig\TwigFilter;
use Twig\TwigFunction;
class SanitizeExtension extends AbstractExtension
{
/**
* Returns a list of filters to add to the existing list.
*
* @return TwigFilter[]
*/
public function getFilters()
{
return [
new TwigFilter(
'escape_js_string',
'PhpMyAdmin\Sanitize::escapeJsString',
['is_safe' => ['html']]
),
new TwigFilter(
'js_format',
'PhpMyAdmin\Sanitize::jsFormat',
['is_safe' => ['html']]
),
new TwigFilter(
'sanitize',
'PhpMyAdmin\Sanitize::sanitizeMessage',
['is_safe' => ['html']]
),
];
}
/**
* Returns a list of functions to add to the existing list.
*
* @return TwigFunction[]
*/
public function getFunctions()
{
return [
new TwigFunction(
'get_js_value',
'PhpMyAdmin\Sanitize::getJsValue',
['is_safe' => ['html']]
),
];
}
}