Skip to content

Commit

Permalink
fix: only allow image files to be used as background
Browse files Browse the repository at this point in the history
sem-ver: bug-fix

Signed-off-by: Oscar <[email protected]>
  • Loading branch information
0scvr authored and Davidy22 committed Oct 10, 2023
1 parent 4a97d19 commit d2d73d5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
11 changes: 10 additions & 1 deletion guake/prefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,8 +536,17 @@ def on_font_style_font_set(self, fbtn):
self.settings.styleFont.set_string("style", fbtn.get_font_name())

def on_background_image_file_chooser_file_changed(self, fc):
allowed_extensions = (
".jpg",
".jpeg",
".png",
".gif",
) # only allow files with these extensions
self.settings.general.set_string(
"background-image-file", fc.get_filename() if fc.get_filename() else ""
"background-image-file",
fc.get_filename()
if fc.get_filename() and fc.get_filename().endswith(allowed_extensions)
else "",
)

def on_background_image_file_remove_clicked(self, btn):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
release_summary: >
Prevent the use of non-image files as the background image. The following file extensions are allowed: .jpg, .jpeg, .png, .gif
fixes:
- |
- Prevent users from setting non-image files as a background image, closes #2205

0 comments on commit d2d73d5

Please sign in to comment.