From 977828aacf9cabeb7134ccdf9bf72aad6588c467 Mon Sep 17 00:00:00 2001 From: td854 Date: Tue, 27 Oct 2026 14:00:00 +0530 Subject: [PATCH 1/2] RDKB-67288 : myrouter.io redirection is not working eventhough secure webui is enabled --- source/Styles/xb3/jst/index.jst | 15 ++++++++++----- source/Styles/xb6/jst/index.jst | 27 ++++++++++++++++++++++----- 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/source/Styles/xb3/jst/index.jst b/source/Styles/xb3/jst/index.jst index 56c967cc..70d2bd4d 100644 --- a/source/Styles/xb3/jst/index.jst +++ b/source/Styles/xb3/jst/index.jst @@ -114,7 +114,8 @@ $psmMode = $DeviceControl_value['psmMode']; $LanGwIP['localAddr'] = ''; $LanGwIP['globalAddr'] = ''; $LanGwIP['ulaAddr'] = ''; - if(strpos($partnerId, "sky-") !== false) { + $secureWebUIRedirectPartner = (strpos($partnerId, "sky-") !== false) || !strcmp($partnerId, "comcast"); + if($secureWebUIRedirectPartner) { $lan_ip = []; $bin = exec("which ifconfig"); $xbin=$bin[0].replace(/ /g,'').replace(/\n/g,''); @@ -176,14 +177,18 @@ function isLocalIPv6($url){ $ip_addr = strpos($SERVER_ADDR, ":") == false ? $LanGwIPv4 : $LanGwIPv6 ; $SecWebUI = getStr("Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.SecureWebUI.Enable"); $LocFqdn = getStr("Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.SecureWebUI.LocalFqdn"); - if(strpos($partnerId, "sky-") !== false) { + if($secureWebUIRedirectPartner) { if (strcmp($SecWebUI, "true")==0) { if (strcmp($url, $LocFqdn)!=0) { - if( (strcmp($url,$ip_addr)==0) || isLocalIPv6($url) ) + if( (strcmp($url,$ip_addr)==0) || isLocalIPv6($url) ) { header('Location:https://'+$LocFqdn); + exit(0); + } + } + else if ((strcmp($url, $LocFqdn)==0) && ($_SERVER["SERVER_PORT"]=="80")) { + header('Location:https://'+$LocFqdn); + exit(0); } - else if ((strcmp($url, $LocFqdn)==0) && ($_SERVER["SERVER_PORT"]=="80")) - header('Location:https://'+$LocFqdn); } } if(!strcmp($CaptivePortalEnable, "true")) { diff --git a/source/Styles/xb6/jst/index.jst b/source/Styles/xb6/jst/index.jst index 75f8a5cb..401c05a8 100644 --- a/source/Styles/xb6/jst/index.jst +++ b/source/Styles/xb6/jst/index.jst @@ -106,7 +106,8 @@ $psmMode = $DeviceControl_value['psmMode']; $LanGwIP['localAddr'] = ''; $LanGwIP['globalAddr'] = ''; $LanGwIP['ulaAddr'] = ''; - if(strpos($partnerId, "sky-") !== false) { + $secureWebUIRedirectPartner = (strpos($partnerId, "sky-") !== false) || !strcmp($partnerId, "comcast"); + if($secureWebUIRedirectPartner) { $lan_ip = []; $bin = exec("which ifconfig"); $xbin=$bin[0].replace(/ /g,'').replace(/\n/g,''); @@ -135,18 +136,34 @@ if(!$isMSO) { exit(0); }*/ +function isLocalIPv6($url){ + //'IPv6 LAN globalAddr' can be same as 'Remote Management Address (IPv6)' + //find local LAN access using SERVER_PORT + $isLocalAddr = false; + $isLocalAddr = ((strcmp($url,$LanGwIPv6)==0) + || (strcmp($url,$LanGwIP['localAddr'])==0) + || (strcmp($url,$LanGwIP['globalAddr'])==0) + || (strcmp($url,$LanGwIP['ulaAddr'])==0)); + $isLocalAddr = ($isLocalAddr && ($_SERVER['SERVER_PORT'] == "80" || $_SERVER['SERVER_PORT'] == "443")); + return $isLocalAddr; +} + $SERVER_ADDR = $_SERVER['SERVER_ADDR']; $ip_addr = strpos($SERVER_ADDR, ":") == false ? $LanGwIPv4 : $LanGwIPv6 ; $SecWebUI = getStr("Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.SecureWebUI.Enable"); $LocFqdn = getStr("Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.SecureWebUI.LocalFqdn"); - if(strpos($partnerId, "sky-") !== false) { + if($secureWebUIRedirectPartner) { if (strcmp($SecWebUI, "true")==0) { if (strcmp($url, $LocFqdn)!=0) { - if( (strcmp($url,$ip_addr)==0) || isLocalIPv6($url) ) - header('Location:https://'+$LocFqdn); + if( (strcmp($url,$ip_addr)==0) || isLocalIPv6($url) ) { + header('Location:https://'+$LocFqdn); + exit(0); + } } - else if ((strcmp($url, $LocFqdn)==0) && ($_SERVER["SERVER_PORT"]=="80")) + else if ((strcmp($url, $LocFqdn)==0) && ($_SERVER["SERVER_PORT"]=="80")) { header('Location:https://'+$LocFqdn); + exit(0); + } } } From 443f51a8ba63e12bfc878d54524427fb4819eb40 Mon Sep 17 00:00:00 2001 From: td854 Date: Tue, 27 Oct 2026 14:00:00 +0530 Subject: [PATCH 2/2] RDKB-67288 : myrouter.io redirection is not working eventhough secure webui is enabled --- source/Styles/xb3/jst/index.jst | 4 +++- source/Styles/xb6/jst/index.jst | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/source/Styles/xb3/jst/index.jst b/source/Styles/xb3/jst/index.jst index 70d2bd4d..dc31a854 100644 --- a/source/Styles/xb3/jst/index.jst +++ b/source/Styles/xb3/jst/index.jst @@ -132,7 +132,9 @@ $psmMode = $DeviceControl_value['psmMode']; else $LanGwIP['ulaAddr'] = trim($tmp[0]); } } - $LanGwIPv6 = $LanGwIP['ulaAddr']; + if($LanGwIP['ulaAddr'] != "") { + $LanGwIPv6 = $LanGwIP['ulaAddr']; + } } function wan_status(){ $wan_connection=false; diff --git a/source/Styles/xb6/jst/index.jst b/source/Styles/xb6/jst/index.jst index 401c05a8..26c18afc 100644 --- a/source/Styles/xb6/jst/index.jst +++ b/source/Styles/xb6/jst/index.jst @@ -124,7 +124,9 @@ $psmMode = $DeviceControl_value['psmMode']; else $LanGwIP['ulaAddr'] = trim($tmp[0]); } } - $LanGwIPv6 = $LanGwIP['ulaAddr']; + if($LanGwIP['ulaAddr'] != "") { + $LanGwIPv6 = $LanGwIP['ulaAddr']; + } } if(!$isMSO) {