Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions source/Styles/xb3/jst/includes/utility.jst
Original file line number Diff line number Diff line change
Expand Up @@ -898,10 +898,10 @@ function updateURL(url){
* return: returns $brandName+' '+$productName
*/
function getBrandProductName(){
$modelName = getStr("Device.DeviceInfo.ModelName");
$modelName = getStr("Device.DeviceInfo.ModelName");
$brandName = getStr("Device.DeviceInfo.X_RDKCENTRAL-COM_Syndication.RDKB_UIBranding.CloudUI.brandname");
$productName = getStr("Device.DeviceInfo.X_RDKCENTRAL-COM_Syndication.RDKB_UIBranding.CloudUI.productname");
$ret = $brandName+' '+$productName;
$ret = '<span>'+$brandName+' '+$productName+'</span>';
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The brandName and productName values retrieved from device settings are being inserted directly into HTML without sanitization. If these values contain special characters or malicious content, this could lead to Cross-Site Scripting (XSS) vulnerabilities. Consider using HTML escaping before concatenating these values into the HTML string, or preferably, handle the HTML wrapping in the presentation layer rather than in this utility function.

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change introduces HTML markup into a utility function that previously returned plain text data. This violates the separation of concerns principle by mixing presentation (HTML structure) with data retrieval logic. All other functions in this file return plain data, not HTML markup. If the iOS font size issue needs to be addressed, it should be done through CSS styling (e.g., using media queries or browser-specific styles) rather than by injecting HTML wrapper elements in the utility function. This approach would also make it easier to apply consistent styling across all usages and would be more maintainable.

Suggested change
$ret = '<span>'+$brandName+' '+$productName+'</span>';
$ret = $brandName+' '+$productName;

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function comment states that it returns brandName + ' ' + productName (a plain string concatenation), but the implementation now returns HTML markup. The comment should be updated to accurately reflect that the function returns an HTML string with a span wrapper, or better yet, the implementation should be reverted to return plain text and the HTML wrapping should be handled in the presentation layer.

Copilot uses AI. Check for mistakes.
return $ret;
}

Expand Down