[rhythmbox] webremote: fix art image filenames



commit 33433f30054ad8d677c87b2f86273d65125d1f3c
Author: Jonathan Matthew <jonathan d14n org>
Date:   Thu Mar 16 08:06:44 2017 +1000

    webremote: fix art image filenames
    
    Create filenames relative to the cache directory, and ensure they don't
    get treated as absolute pathnames.

 plugins/webremote/webremote.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/plugins/webremote/webremote.py b/plugins/webremote/webremote.py
index 9dac209..96cc0a9 100644
--- a/plugins/webremote/webremote.py
+++ b/plugins/webremote/webremote.py
@@ -293,7 +293,8 @@ class WebRemotePlugin(GObject.Object, Peas.Activatable):
                if filename.startswith(self.artcache) is False:
                        return None
 
-               return os.path.normpath(filename)
+               rfn = filename[len(self.artcache):].lstrip('/')
+               return os.path.normpath(rfn)
 
 
        def entry_details(self, entry):
@@ -436,7 +437,7 @@ class WebRemotePlugin(GObject.Object, Peas.Activatable):
                        msg.set_status(404)
                        return
 
-               if re.match("/art/[a-zA-Z0-9/]+", path) is None:
+               if re.match("/art/[^/][a-zA-Z0-9/]+", path) is None:
                        msg.set_status(404)
                        return
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]