From 9f962eb40fd932ab129ab7184f45932635c6348f Mon Sep 17 00:00:00 2001 From: Molkobain Date: Mon, 18 Jan 2021 10:26:15 +0100 Subject: [PATCH] Add Config::IsCustomValue($sPropCode) method to know if a parameter has been changed or not --- core/config.class.inc.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/core/config.class.inc.php b/core/config.class.inc.php index 7faec4710..f454c8caf 100644 --- a/core/config.class.inc.php +++ b/core/config.class.inc.php @@ -1412,6 +1412,19 @@ class Config return $this->m_aSettings[$sPropCode]['value']; } + /** + * Return true is the $sPropCode parameter has been customized, false if it is the default value. + * + * @param string $sPropCode + * + * @return bool + * @since 3.0.0 + */ + public function IsCustomValue(string $sPropCode): bool + { + return $this->m_aSettings[$sPropCode]['value'] !== $this->m_aSettings[$sPropCode]['default']; + } + /** * Event log options (see LOG_... definition) */