diff options
| author | Eduard Braun <eduard.braun2@gmx.de> | 2017-02-13 23:42:11 +0000 |
|---|---|---|
| committer | Eduard Braun <eduard.braun2@gmx.de> | 2017-02-13 23:42:11 +0000 |
| commit | 24d66b5173963dcb69545614449de91da5397db6 (patch) | |
| tree | 2af56ea35b6224d3d205f53727740af638da0e16 /src/extension/param/description.cpp | |
| parent | Extensions: Fix potential security issue with "description" parameters. (diff) | |
| download | inkscape-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/description.cpp')
| -rw-r--r-- | src/extension/param/description.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/extension/param/description.cpp b/src/extension/param/description.cpp index 3d970b204..7cf818280 100644 --- a/src/extension/param/description.cpp +++ b/src/extension/param/description.cpp @@ -80,6 +80,9 @@ ParamDescription::get_widget (SPDocument * /*doc*/, Inkscape::XML::Node * /*node label->set_markup(Glib::ustring("<b>") + Glib::Markup::escape_text(newguitext) + Glib::ustring("</b>")); label->set_margin_top(5); label->set_margin_bottom(5); + } else if (_mode == URL) { + Glib::ustring escaped_url = Glib::Markup::escape_text(newguitext); + label->set_markup(Glib::ustring::compose("<a href='%1'>%1</a>", escaped_url)); } else { label->set_text(newguitext); } |
