From 0631f5b211b7d629c0abb05d551f9e46591a861a Mon Sep 17 00:00:00 2001 From: anonymoususer72041 <247563575+anonymoususer72041@users.noreply.github.com> Date: Sat, 2 May 2026 15:18:12 +0200 Subject: [PATCH] Prefill installer phone country code from existing site settings --- modules/install/ajax/ui.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/modules/install/ajax/ui.php b/modules/install/ajax/ui.php index cc601d92f..b69802560 100755 --- a/modules/install/ajax/ui.php +++ b/modules/install/ajax/ui.php @@ -492,6 +492,23 @@ echo 'document.getElementById(\'dateFormat\').value = \'dmy\';'; } + /* Detect default phone country calling code. */ + $defaultPhoneCountryCodeDigits = ''; + $rsPhoneCountryCode = MySQLQuery('SELECT default_phone_country_code FROM site', true); + if ($rsPhoneCountryCode) + { + $phoneCountryCodeRecord = mysqli_fetch_assoc($rsPhoneCountryCode); + if (isset($phoneCountryCodeRecord['default_phone_country_code'])) + { + $defaultPhoneCountryCodeDigits = preg_replace( + '/[^0-9]/', + '', + trim($phoneCountryCodeRecord['default_phone_country_code']) + ); + } + } + echo 'document.getElementById(\'defaultPhoneCountryCodeDigits\').value = \'' . addslashes($defaultPhoneCountryCodeDigits) . '\';'; + echo 'setActiveStep(6);'; echo 'showTextBlock(\'pickOptionalComponents\');'; echo '';