Skip to content

Commit 4fec463

Browse files
committed
fix: whitelist OpenEMR symbols in composer-require-checker
These symbols come from the host OpenEMR application at runtime. openemr/openemr is a dev-only dependency (not declared in require) so the checker must allow them explicitly. Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8170c99 commit 4fec463

4 files changed

Lines changed: 12 additions & 6 deletions

File tree

.composer-require-checker.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@
1414
"callable",
1515
"iterable",
1616
"void",
17-
"object"
17+
"object",
18+
"attr",
19+
"xlt",
20+
"OpenEMR\\Common\\Crypto\\CryptoGen",
21+
"OpenEMR\\Common\\Database\\QueryUtils",
22+
"OpenEMR\\Events\\Globals\\GlobalsInitializedEvent",
23+
"OpenEMR\\Services\\Globals\\GlobalSetting"
1824
],
1925
"php-core-extensions": [
2026
"Core",

src/ConfigService.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ class ConfigService
1717
{
1818
private const UPSERT_SQL = <<<'SQL'
1919
INSERT INTO `globals` (`gl_name`, `gl_index`, `gl_value`)
20-
VALUES (?, 0, ?)
21-
ON DUPLICATE KEY UPDATE `gl_value` = VALUES(`gl_value`)
20+
VALUES (?, 0, ?) AS new
21+
ON DUPLICATE KEY UPDATE `gl_value` = new.`gl_value`
2222
SQL;
2323

2424
/**

src/GlobalsRegistrar.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ static function (GlobalsInitializedEvent $event) use ($descriptor, $globalsBag):
4242

4343
// Enable/disable toggle
4444
$enableSetting = new GlobalSetting(
45-
xlt('Enable ' . $descriptor->sectionName),
45+
sprintf(xlt('Enable %s'), $descriptor->sectionName),
4646
GlobalSetting::DATA_TYPE_BOOL,
4747
'0',
48-
xlt('Enable or disable the ' . $descriptor->sectionName . ' module'),
48+
sprintf(xlt('Enable or disable the %s module'), $descriptor->sectionName),
4949
);
5050
$service->appendToSection(
5151
$descriptor->sectionName,

tests/Mocks/openemr_functions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ function xlt(string $text): string
1515
if (!function_exists('attr')) {
1616
function attr(string $text): string
1717
{
18-
return htmlspecialchars($text, ENT_QUOTES);
18+
return htmlspecialchars($text, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
1919
}
2020
}

0 commit comments

Comments
 (0)