Page MenuHomeFeedback Tracker

ctrlSetURL does not work with file:/// URI
New, NormalPublic

Description

The ctrlSetURL command does not work the same way the config attribute url does. The attribute can link to files (and folders):

class Ctrl: RscText
{
  idc = -1;
  text = "Open";
  url = "file:///P:/buldozer.cfg";
  x = 0;
  y = 0;
  w = 1;
  h = 1;
};

but the command can not:

_ctrl ctrlSetURL "file:///P:/buldozer.cfg"; // does not set the URI

Details

Severity
Minor
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Category
Scripting

Event Timeline

7erra created this task.Dec 5 2020, 5:54 PM
dedmen added a subscriber: dedmen.Dec 16 2020, 11:30 AM

can it execute .exe files? when you click on the url?

Yes it can. The following example opens the cmd window:

class TestDisplay
{
    idd = -1;
    class controls
    {
        class URLButton
        {
            text = "Open CMD";
            url = "C:\Windows\System32\cmd.exe";
            x = 0;
            y = 0;
            w = 1;
            h = 1;
            deletable = 0;
            fade = 0;
            access = 0;
            type = 1;
            colorText[] = {1,1,1,1};
            colorDisabled[] = {1,1,1,0.25};
            colorBackground[] = {0,0,0,0.5};
            colorBackgroundDisabled[] = {0,0,0,0.5};
            colorBackgroundActive[] = {0,0,0,1};
            colorFocused[] = {0,0,0,1};
            colorShadow[] = {0,0,0,0};
            colorBorder[] = {0,0,0,1};
            soundEnter[] = {"\A3\ui_f\data\sound\RscButton\soundEnter",0.09,1};
            soundPush[] = {"\A3\ui_f\data\sound\RscButton\soundPush",0.09,1};
            soundClick[] = {"\A3\ui_f\data\sound\RscButton\soundClick",0.09,1};
            soundEscape[] = {"\A3\ui_f\data\sound\RscButton\soundEscape",0.09,1};
            idc = -1;
            style = 2;
            shadow = 2;
            font = "RobotoCondensed";
            sizeEx = "(			(			(			((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
            offsetX = 0;
            offsetY = 0;
            offsetPressedX = 0;
            offsetPressedY = 0;
            borderSize = 0;
        };
    };
};

But isn't this dangerous?! Especially if it also supports command line arguments