diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-02-15 05:05:51 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-02-15 05:06:46 +0400 |
commit | 2413b444d0c41639c49cd3bc76364077eff7d9da (patch) | |
tree | 4eaf79a0999eebe7330801b273fb1eca4bb284b4 /source | |
parent | 01d9bbaa5ef914b779bc00decd85f9336340db26 (diff) |
Fix T38640: password values showed in tooltips
also disable copying password text.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 7 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_regions.c | 15 |
2 files changed, 16 insertions, 6 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index cfdc0c87fed..a426cbd69ac 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -1677,6 +1677,13 @@ static void ui_but_copy_paste(bContext *C, uiBut *but, uiHandleButtonData *data, return; } + if (mode == 'c') { + /* disallow copying from any passwords */ + if (but->rnaprop && (RNA_property_subtype(but->rnaprop) == PROP_PASSWORD)) { + return; + } + } + if (mode == 'v') { /* extract first line from clipboard in case of multi-line copies */ int pbuf_len; diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index 0dc10088d81..cb52e0cfbd8 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -325,12 +325,15 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but) } if (ELEM3(but->type, TEX, SEARCH_MENU, SEARCH_MENU_UNLINK)) { - /* full string */ - ui_get_but_string(but, buf, sizeof(buf)); - if (buf[0]) { - BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_("Value: %s"), buf); - data->color_id[data->totline] = UI_TIP_LC_NORMAL; - data->totline++; + /* better not show the value of a password */ + if ((but->rnaprop && (RNA_property_subtype(but->rnaprop) == PROP_PASSWORD)) == 0) { + /* full string */ + ui_get_but_string(but, buf, sizeof(buf)); + if (buf[0]) { + BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_("Value: %s"), buf); + data->color_id[data->totline] = UI_TIP_LC_NORMAL; + data->totline++; + } } } |