Merge pull request #13825 from Cameron653/rcon_sanitization

Sanitization
This commit is contained in:
Casey
2022-10-02 13:58:21 -04:00
committed by GitHub
27 changed files with 83 additions and 53 deletions
+1 -1
View File
@@ -33,7 +33,7 @@
/obj/structure/closet/body_bag/attackby(var/obj/item/W as obj, mob/user as mob)
if (istype(W, /obj/item/weapon/pen))
var/t = tgui_input_text(user, "What would you like the label to be?", text("[]", src.name), null)
var/t = tgui_input_text(user, "What would you like the label to be?", text("[]", src.name), null, MAX_NAME_LEN )
if (user.get_active_hand() != W)
return
if (!in_range(src, user) && src.loc != user)
+4 -4
View File
@@ -137,7 +137,7 @@ var/list/GPS_list = list()
if(emped)
to_chat(user, "It's busted!")
return
toggle_tracking()
if(tracking)
to_chat(user, "[src] is no longer tracking, or visible to other GPS devices.")
@@ -194,7 +194,7 @@ var/list/GPS_list = list()
dat["curr_z"] = curr.z
dat["curr_z_name"] = strip_improper(using_map.get_zlevel_name(curr.z))
dat["z_level_detection"] = using_map.get_map_levels(curr.z, long_range)
var/list/gps_list = list()
for(var/obj/item/device/gps/G in GPS_list - src)
@@ -250,7 +250,7 @@ var/list/GPS_list = list()
dat += "<tr>"
var/gps_ref = "\ref[gps["ref"]]"
dat += "<td>[gps["gps_tag"]]</td><td>[gps["area_name"]]</td>"
if(istype(gps_data["ref"], /obj/item/device/gps/internal/poi))
dat += "<td>[gps["local"] ? "[gps["direction"]] Dist: [round(gps["distance"], 10)]m" : "[gps["z_name"]]"]</td>"
else
@@ -323,7 +323,7 @@ var/list/GPS_list = list()
. = TRUE
if(href_list["tag"])
var/a = tgui_input_text(usr, "Please enter desired tag.", name, gps_tag)
var/a = tgui_input_text(usr, "Please enter desired tag.", name, gps_tag, 10)
a = uppertext(copytext(sanitize(a), 1, 11))
if(in_range(src, usr))
gps_tag = a
+2 -1
View File
@@ -65,7 +65,8 @@
if(..())
return 1
if(href_list["channel"])
var/nc = tgui_input_text(usr, "Channel name", "Select new channel name", channel)
var/nc = tgui_input_text(usr, "Channel name", "Select new channel name", channel, MAX_NAME_LEN)
nc = sanitize(nc,MAX_NAME_LEN)
if(nc)
channel = nc
camera.c_tag = channel
@@ -21,7 +21,7 @@
/obj/item/weapon/implantcase/attackby(obj/item/weapon/I as obj, mob/user as mob)
..()
if (istype(I, /obj/item/weapon/pen))
var/t = tgui_input_text(user, "What would you like the label to be?", text("[]", src.name), null)
var/t = tgui_input_text(user, "What would you like the label to be?", text("[]", src.name), null, MAX_NAME_LEN)
if (user.get_active_hand() != I)
return
if((!in_range(src, usr) && src.loc != user))