mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-10 04:50:16 +02:00
Use regex to determine the SMF version (thanks @colcrunch)
This commit is contained in:
parent
a0d14eb1d3
commit
cbdce18633
@ -67,9 +67,12 @@ class SmfManager:
|
|||||||
cursor = connections['smf'].cursor()
|
cursor = connections['smf'].cursor()
|
||||||
cursor.execute(cls.SQL_GET_CURRENT_SMF_VERSION, ['current-version.js'])
|
cursor.execute(cls.SQL_GET_CURRENT_SMF_VERSION, ['current-version.js'])
|
||||||
row = cursor.fetchone()
|
row = cursor.fetchone()
|
||||||
smf_version_string = row[0]
|
db_result = row[0]
|
||||||
|
|
||||||
smf_version = smf_version_string.replace('window.smfVersion = "SMF ', '').replace('";', '')
|
pattern = re.compile(r"\d+(\.\d+)+")
|
||||||
|
result = pattern.search(db_result)
|
||||||
|
|
||||||
|
smf_version = result.group(0)
|
||||||
|
|
||||||
return smf_version
|
return smf_version
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user