Skip to content

Commit ac3502e

Browse files
authored
Fixed registration of secret value displayer only for existing ini_directives (#36) (#37)
1 parent 72a99fb commit ac3502e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

prod/native/extension/code/ModuleIniEntries.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ bool registerIniEntries(opentelemetry::php::LoggerInterface *log, int module_num
6969

7070
auto iniName = opentelemetry::utils::getIniName(option.first);
7171

72+
if (zend_hash_str_find_ptr(EG(ini_directives), iniName.data(), iniName.length()) == nullptr) {
73+
continue;
74+
}
75+
7276
if (zend_ini_register_displayer(iniName.data(), iniName.length(), displaySecretIniValue) != ZEND_RESULT_CODE::SUCCESS) {
7377
ELOGF_WARNING(log, MODULE, "zend_ini_register_displayer() failed; iniName: " PRsv, PRsvArg(iniName));
7478
}

0 commit comments

Comments
 (0)