summaryrefslogtreecommitdiffstats
path: root/src/extension/param/parameter.cpp
diff options
context:
space:
mode:
authorEduard Braun <eduard.braun2@gmx.de>2017-02-13 23:42:11 +0000
committerEduard Braun <eduard.braun2@gmx.de>2017-02-13 23:42:11 +0000
commit24d66b5173963dcb69545614449de91da5397db6 (patch)
tree2af56ea35b6224d3d205f53727740af638da0e16 /src/extension/param/parameter.cpp
parentExtensions: Fix potential security issue with "description" parameters. (diff)
downloadinkscape-24d66b5173963dcb69545614449de91da5397db6.tar.gz
inkscape-24d66b5173963dcb69545614449de91da5397db6.zip
Extensions: Add 'appearance="url"' to desccription parameters.
It allows to create and add a clickable plain text link to extensions The description parameter's text is escaped and converted to a URL as-is preventing potential security issues The Scour extension shows a first example implementation (bzr r15519)
Diffstat (limited to 'src/extension/param/parameter.cpp')
-rw-r--r--src/extension/param/parameter.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/extension/param/parameter.cpp b/src/extension/param/parameter.cpp
index 9fbe662f7..0eb491078 100644
--- a/src/extension/param/parameter.cpp
+++ b/src/extension/param/parameter.cpp
@@ -135,11 +135,15 @@ Parameter *Parameter::make(Inkscape::XML::Node *in_repr, Inkscape::Extension::Ex
ps->setMaxLength(atoi(max_length));
}
} else if (!strcmp(type, "description")) {
- if (appearance && !strcmp(appearance, "header")) {
- param = new ParamDescription(name, guitext, desc, scope, gui_hidden, gui_tip, indent, in_ext, in_repr, ParamDescription::HEADER);
- } else {
- param = new ParamDescription(name, guitext, desc, scope, gui_hidden, gui_tip, indent, in_ext, in_repr, ParamDescription::DESC);
+ ParamDescription::AppearanceMode appearance_mode = ParamDescription::DESC;
+ if (appearance) {
+ if (!strcmp(appearance, "header")) {
+ appearance_mode = ParamDescription::HEADER;
+ } else if (!strcmp(appearance, "url")) {
+ appearance_mode = ParamDescription::URL;
+ }
}
+ param = new ParamDescription(name, guitext, desc, scope, gui_hidden, gui_tip, indent, in_ext, in_repr, appearance_mode);
} else if (!strcmp(type, "enum")) {
param = new ParamComboBox(name, guitext, desc, scope, gui_hidden, gui_tip, indent, in_ext, in_repr);
} else if (!strcmp(type, "notebook")) {