mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-10 09:54:52 +00:00
Update browserOutput.dm
This commit is contained in:
@@ -2,6 +2,9 @@
|
|||||||
For the main html chat area
|
For the main html chat area
|
||||||
*********************************/
|
*********************************/
|
||||||
|
|
||||||
|
#define BICON_X_MAX 96
|
||||||
|
#define BICON_Y_MAX 96
|
||||||
|
|
||||||
//Precaching a bunch of shit
|
//Precaching a bunch of shit
|
||||||
GLOBAL_DATUM_INIT(iconCache, /savefile, new("data/iconCache.sav")) //Cache of icons for the browser output
|
GLOBAL_DATUM_INIT(iconCache, /savefile, new("data/iconCache.sav")) //Cache of icons for the browser output
|
||||||
|
|
||||||
@@ -188,6 +191,10 @@ GLOBAL_LIST_EMPTY(bicon_cache)
|
|||||||
/proc/icon2base64(icon/icon, iconKey = "misc")
|
/proc/icon2base64(icon/icon, iconKey = "misc")
|
||||||
if (!isicon(icon))
|
if (!isicon(icon))
|
||||||
return FALSE
|
return FALSE
|
||||||
|
//DOS exploit
|
||||||
|
if(icon.Width() > BICON_X_MAX || icon.Length() > BICON_Y_MAX)
|
||||||
|
return FALSE
|
||||||
|
//
|
||||||
GLOB.iconCache[iconKey] << icon
|
GLOB.iconCache[iconKey] << icon
|
||||||
var/iconData = GLOB.iconCache.ExportText(iconKey)
|
var/iconData = GLOB.iconCache.ExportText(iconKey)
|
||||||
var/list/partial = splittext(iconData, "{")
|
var/list/partial = splittext(iconData, "{")
|
||||||
@@ -286,4 +293,4 @@ GLOBAL_LIST_EMPTY(bicon_cache)
|
|||||||
return M.current.client
|
return M.current.client
|
||||||
|
|
||||||
/datum/log //exists purely to capture to_chat() output
|
/datum/log //exists purely to capture to_chat() output
|
||||||
var/log = ""
|
var/log = ""
|
||||||
|
|||||||
Reference in New Issue
Block a user