diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 7085626ef..68d5d6d3d 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -29,7 +29,7 @@ Some of the code for this form is based on the examples at: """ -import cgi +import html import logging from PyQt4 import QtCore, QtGui, QtWebKit, QtOpenGL @@ -273,7 +273,7 @@ class MainDisplay(OpenLPMixin, Display, RegistryProperties): """ # First we convert <>& marks to html variants, then apply # formattingtags, finally we double all backslashes for JavaScript. - text_prepared = expand_tags(cgi.escape(text)).replace('\\', '\\\\').replace('\"', '\\\"') + text_prepared = expand_tags(html.escape(text)).replace('\\', '\\\\').replace('\"', '\\\"') if self.height() != self.screen['size'].height() or not self.isVisible(): shrink = True js = 'show_alert("%s", "%s")' % (text_prepared, 'top') diff --git a/openlp/plugins/songs/lib/openlyricsxml.py b/openlp/plugins/songs/lib/openlyricsxml.py index b9f6b6bd1..e6b01cfb8 100644 --- a/openlp/plugins/songs/lib/openlyricsxml.py +++ b/openlp/plugins/songs/lib/openlyricsxml.py @@ -55,7 +55,7 @@ The XML of an `OpenLyrics `_ song looks like this:: """ -import cgi +import html import logging import re @@ -318,7 +318,7 @@ class OpenLyrics(object): if 'lang' in verse[0]: verse_element.set('lang', verse[0]['lang']) # Create a list with all "optional" verses. - optional_verses = cgi.escape(verse[1]) + optional_verses = html.escape(verse[1]) optional_verses = optional_verses.split('\n[---]\n') start_tags = '' end_tags = ''