ASCII encode md5 string. closes #2167

This commit is contained in:
Ruud
2013-09-19 23:39:15 +02:00
parent c75ac51eb7
commit c8ab6a06fb
4 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -56,7 +56,7 @@ class Core(Plugin):
self.signalHandler()
def md5Password(self, value):
return md5(value.encode(Env.get('encoding'))) if value else ''
return md5(value) if value else ''
def checkApikey(self, value):
return value if value and len(value) > 3 else uuid4().hex
+1 -1
View File
@@ -101,7 +101,7 @@ def flattenList(l):
return l
def md5(text):
return hashlib.md5(text).hexdigest()
return hashlib.md5(ss(text)).hexdigest()
def sha1(text):
return hashlib.sha1(text).hexdigest()
@@ -1,7 +1,7 @@
from couchpotato import get_session
from couchpotato.api import addApiView
from couchpotato.core.event import addEvent, fireEvent, fireEventAsync
from couchpotato.core.helpers.encoding import simplifyString, toUnicode
from couchpotato.core.helpers.encoding import simplifyString, toUnicode, ss
from couchpotato.core.helpers.variable import md5, getTitle, splitString, \
possibleTitles, getImdb
from couchpotato.core.logger import CPLog
+2 -2
View File
@@ -259,7 +259,7 @@ class Plugin(object):
def getCache(self, cache_key, url = None, **kwargs):
cache_key_md5 = md5(ss(cache_key))
cache_key_md5 = md5(cache_key)
cache = Env.get('cache').get(cache_key_md5)
if cache:
if not Env.get('dev'): log.debug('Getting cache %s', cache_key)
@@ -284,7 +284,7 @@ class Plugin(object):
return ''
def setCache(self, cache_key, value, timeout = 300):
cache_key_md5 = md5(ss(cache_key))
cache_key_md5 = md5(cache_key)
log.debug('Setting cache %s', cache_key)
Env.get('cache').set(cache_key_md5, value, timeout)
return value