Anonymous avatar Anonymous committed 11aaffd

don't escape html for window title

Comments (0)

Files changed (1)

                 name = item.directory.split('/')[-1]
                 self.browserdata.append([gtk.STOCK_OPEN, item.directory, escape_html(name)])
             elif item.type == 'file':
-                self.browserdata.append(['sonata', item.file, self.parse_formatting(self.libraryformat, item)])
+                self.browserdata.append(['sonata', item.file, self.parse_formatting(self.libraryformat, item, True)])
         self.browser.thaw_child_notify()
 
         # Scroll back to set view for current dir:
             except:
                 pass
 
-    def parse_formatting(self, format, item):
+    def parse_formatting(self, format, item, use_escape_html):
         if self.song_has_metadata(item):
             text = format
             if "%A" in text:
                 text = text.replace("%F", item.file)
             if "%P" in text:
                 text = text.replace("%P", item.file.split('/')[-1])
-            return escape_html(text)
+            if use_escape_html:
+                return escape_html(text)
+            else:
+                return text
         else:
             return self.filename_or_fullpath(item.file)
 
 
     def update_wintitle(self):
         if self.conn and self.status and self.status.state in ['play', 'pause']:
-            self.window.set_property('title', self.parse_formatting(self.titleformat, self.songinfo))
+            self.window.set_property('title', self.parse_formatting(self.titleformat, self.songinfo, False))
         else:
             self.window.set_property('title', 'Sonata')
 
             self.currentdata.clear()
             self.current.freeze_child_notify()
             for track in self.songs:
-                self.currentdata.append([int(track.id), self.parse_formatting(self.currentformat, track)])
+                self.currentdata.append([int(track.id), self.parse_formatting(self.currentformat, track, True)])
             self.current.thaw_child_notify()
             if self.status.state in ['play', 'pause']:
                 row = int(self.songinfo.pos)
                     name = item.directory.split('/')[-1]
                     self.browserdata.append([gtk.STOCK_OPEN, item.directory, escape_html(name)])
                 elif item.type == 'file':
-                    self.browserdata.append(['sonata', item.file, self.parse_formatting(self.libraryformat, item)])
+                    self.browserdata.append(['sonata', item.file, self.parse_formatting(self.libraryformat, item, True)])
             self.browser.grab_focus()
             self.browser.scroll_to_point(0, 0)
             self.searchbutton.show()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.