mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 03:57:13 +01:00
Merge pull request #367 from Markolie/master
Switch copytext and sanitize proc
This commit is contained in:
@@ -65,7 +65,7 @@
|
||||
/mob/camera/blob/proc/blob_talk(message)
|
||||
log_say("[key_name(src)] : [message]")
|
||||
|
||||
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
|
||||
message = trim(sanitize(copytext(message, 1, MAX_MESSAGE_LEN)))
|
||||
|
||||
if (!message)
|
||||
return
|
||||
|
||||
@@ -564,7 +564,7 @@ ________________________________________________________________________________
|
||||
if("Message")
|
||||
var/obj/item/device/pda/P = locate(href_list["target"])
|
||||
var/t = input(U, "Please enter untraceable message.") as text
|
||||
t = copytext(sanitize(t), 1, MAX_MESSAGE_LEN)
|
||||
t = sanitize(copytext(t, 1, MAX_MESSAGE_LEN))
|
||||
if(!t||U.stat||U.wear_suit!=src||!s_initialized)//Wow, another one of these. Man...
|
||||
display_to << browse(null, "window=spideros")
|
||||
return
|
||||
|
||||
@@ -480,7 +480,7 @@ As such, it's hard-coded for now. No reason for it not to be, really.
|
||||
var/mission
|
||||
if(alert("Would you the Ninja to have a random or preset mission?",,"Random","Preset")=="Preset")
|
||||
while(!mission)
|
||||
mission = copytext(sanitize(input(src, "Please specify which mission the space ninja shall undertake.", "Specify Mission", "")),1,MAX_MESSAGE_LEN)
|
||||
mission = sanitize(copytext(input(src, "Please specify which mission the space ninja shall undertake.", "Specify Mission", ""),1,MAX_MESSAGE_LEN))
|
||||
if(!mission)
|
||||
if(alert("Error, no mission set. Do you want to exit the setup process?",,"Yes","No")=="Yes")
|
||||
return
|
||||
|
||||
@@ -441,7 +441,7 @@ proc/issyndicate(mob/living/M as mob)
|
||||
|
||||
/proc/nukelastname(var/mob/M as mob) //--All praise goes to NEO|Phyte, all blame goes to DH, and it was Cindi-Kate's idea. Also praise Urist for copypasta ho.
|
||||
var/randomname = pick(last_names)
|
||||
var/newname = copytext(sanitize(input(M,"You are the nuke operative [pick("Czar", "Boss", "Commander", "Chief", "Kingpin", "Director", "Overlord")]. Please choose a last name for your family.", "Name change",randomname)),1,MAX_NAME_LEN)
|
||||
var/newname = sanitize(copytext(input(M,"You are the nuke operative [pick("Czar", "Boss", "Commander", "Chief", "Kingpin", "Director", "Overlord")]. Please choose a last name for your family.", "Name change",randomname),1,MAX_NAME_LEN))
|
||||
|
||||
if (!newname)
|
||||
newname = randomname
|
||||
|
||||
@@ -619,7 +619,7 @@ datum/objective/steal
|
||||
var/tmp_obj = new O.typepath
|
||||
var/custom_name = tmp_obj:name
|
||||
del(tmp_obj)
|
||||
O.name = copytext(sanitize(input("Enter target name:", "Objective target", custom_name) as text|null),1,MAX_NAME_LEN)
|
||||
O.name = sanitize(copytext(input("Enter target name:", "Objective target", custom_name) as text|null,1,MAX_NAME_LEN))
|
||||
if (!O.name) return
|
||||
steal_target = O
|
||||
explanation_text = "Steal [O.name]."
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
var/wizard_name_first = pick(wizard_first)
|
||||
var/wizard_name_second = pick(wizard_second)
|
||||
var/randomname = "[wizard_name_first] [wizard_name_second]"
|
||||
var/newname = copytext(sanitize(input(M, "You are the wizard's apprentice. Would you like to change your name to something else?", "Name change", randomname) as null|text),1,MAX_NAME_LEN)
|
||||
var/newname = sanitize(copytext(input(M, "You are the wizard's apprentice. Would you like to change your name to something else?", "Name change", randomname) as null|text,1,MAX_NAME_LEN))
|
||||
|
||||
if (!newname)
|
||||
newname = randomname
|
||||
|
||||
@@ -116,7 +116,7 @@
|
||||
var/wizard_name_second = pick(wizard_second)
|
||||
var/randomname = "[wizard_name_first] [wizard_name_second]"
|
||||
spawn(0)
|
||||
var/newname = copytext(sanitize(input(wizard_mob, "You are the Space Wizard. Would you like to change your name to something else?", "Name change", randomname) as null|text),1,MAX_NAME_LEN)
|
||||
var/newname = sanitize(copytext(input(wizard_mob, "You are the Space Wizard. Would you like to change your name to something else?", "Name change", randomname) as null|text,1,MAX_NAME_LEN))
|
||||
|
||||
if (!newname)
|
||||
newname = randomname
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
H.equip_or_collect(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
|
||||
spawn(0)
|
||||
var/religion_name = "Christianity"
|
||||
var/new_religion = copytext(sanitize(input(H, "You are the crew services officer. Would you like to change your religion? Default is Christianity, in SPACE.", "Name change", religion_name)),1,MAX_NAME_LEN)
|
||||
var/new_religion = sanitize(copytext(input(H, "You are the crew services officer. Would you like to change your religion? Default is Christianity, in SPACE.", "Name change", religion_name),1,MAX_NAME_LEN))
|
||||
|
||||
if (!new_religion)
|
||||
new_religion = religion_name
|
||||
@@ -59,7 +59,7 @@
|
||||
|
||||
spawn(1)
|
||||
var/deity_name = "Space Jesus"
|
||||
var/new_deity = copytext(sanitize(input(H, "Would you like to change your deity? Default is Space Jesus.", "Name change", deity_name)),1,MAX_NAME_LEN)
|
||||
var/new_deity = sanitize(copytext(input(H, "Would you like to change your deity? Default is Space Jesus.", "Name change", deity_name),1,MAX_NAME_LEN))
|
||||
|
||||
if ((length(new_deity) == 0) || (new_deity == "Space Jesus") )
|
||||
new_deity = deity_name
|
||||
|
||||
@@ -470,7 +470,7 @@ update_flag
|
||||
|
||||
if (href_list["rename"])
|
||||
if (can_label)
|
||||
var/T = copytext(sanitize(input("Choose canister label", "Name", name) as text|null),1,MAX_NAME_LEN)
|
||||
var/T = sanitize(copytext(input("Choose canister label", "Name", name) as text|null,1,MAX_NAME_LEN))
|
||||
if (can_label) //Exploit prevention
|
||||
if (T)
|
||||
name = T
|
||||
|
||||
@@ -585,7 +585,7 @@
|
||||
|
||||
else if(istype(W, /obj/item/weapon/pen))
|
||||
var/t = input(user, "Enter new robot name", src.name, src.created_name) as text
|
||||
t = copytext(sanitize(t), 1, MAX_NAME_LEN)
|
||||
t = sanitize(copytext(t), 1, MAX_NAME_LEN)
|
||||
if (!t)
|
||||
return
|
||||
if (!in_range(src, usr) && src.loc != usr)
|
||||
|
||||
@@ -324,7 +324,7 @@ var/global/mulebot_count = 0
|
||||
|
||||
if("setid")
|
||||
refresh=0
|
||||
var/new_id = copytext(sanitize(input("Enter new bot ID", "Mulebot [suffix ? "([suffix])" : ""]", suffix) as text|null),1,MAX_NAME_LEN)
|
||||
var/new_id = sanitize(copytext(input("Enter new bot ID", "Mulebot [suffix ? "([suffix])" : ""]", suffix) as text|null,1,MAX_NAME_LEN))
|
||||
refresh=1
|
||||
if(new_id)
|
||||
suffix = new_id
|
||||
|
||||
@@ -198,7 +198,7 @@
|
||||
if (is_authenticated() && modify)
|
||||
var/t1 = href_list["assign_target"]
|
||||
if(t1 == "Custom")
|
||||
var/temp_t = copytext(sanitize(input("Enter a custom job assignment.","Assignment")),1,MAX_MESSAGE_LEN)
|
||||
var/temp_t = sanitize(copytext(input("Enter a custom job assignment.","Assignment"),1,MAX_MESSAGE_LEN))
|
||||
//let custom jobs function as an impromptu alt title, mainly for sechuds
|
||||
if(temp_t && modify)
|
||||
modify.assignment = temp_t
|
||||
|
||||
@@ -422,7 +422,7 @@
|
||||
//Enter message
|
||||
if("Message")
|
||||
custommessage = input(usr, "Please enter your message.") as text|null
|
||||
custommessage = copytext(sanitize(custommessage), 1, MAX_MESSAGE_LEN)
|
||||
custommessage = sanitize(copytext(custommessage, 1, MAX_MESSAGE_LEN))
|
||||
|
||||
//Send message
|
||||
if("Send")
|
||||
|
||||
@@ -129,7 +129,7 @@
|
||||
usr << "Unauthorized Access."
|
||||
|
||||
else if(href_list["warn"])
|
||||
var/warning = copytext(sanitize(input(usr,"Message:","Enter your message here!","")),1,MAX_MESSAGE_LEN)
|
||||
var/warning = sanitize(copytext(input(usr,"Message:","Enter your message here!",""),1,MAX_MESSAGE_LEN))
|
||||
if(!warning) return
|
||||
var/obj/item/weapon/implant/I = locate(href_list["warn"])
|
||||
if((I)&&(I.imp_in))
|
||||
|
||||
@@ -323,7 +323,7 @@
|
||||
if(speed <= 0)
|
||||
speed = 1
|
||||
if("setpath")
|
||||
var/newpath = copytext(sanitize(input(usr, "Please define a new path!",,path) as text|null),1,MAX_MESSAGE_LEN)
|
||||
var/newpath = sanitize(copytext(input(usr, "Please define a new path!",,path) as text|null,1,MAX_MESSAGE_LEN))
|
||||
if(newpath && newpath != "")
|
||||
moving = 0 // stop moving
|
||||
path = newpath
|
||||
|
||||
@@ -193,7 +193,7 @@ Transponder Codes:<UL>"}
|
||||
updateDialog()
|
||||
|
||||
else if(href_list["locedit"])
|
||||
var/newloc = copytext(sanitize(input("Enter New Location", "Navigation Beacon", location) as text|null),1,MAX_MESSAGE_LEN)
|
||||
var/newloc = sanitize(copytext(input("Enter New Location", "Navigation Beacon", location) as text|null,1,MAX_MESSAGE_LEN))
|
||||
if(newloc)
|
||||
location = newloc
|
||||
updateDialog()
|
||||
|
||||
@@ -944,7 +944,7 @@ obj/item/weapon/newspaper/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
user << "<FONT COLOR='blue'>There's already a scribble in this page... You wouldn't want to make things too cluttered, would you?</FONT>"
|
||||
else
|
||||
var/s = strip_html( input(user, "Write something", "Newspaper", "") )
|
||||
s = copytext(sanitize(s), 1, MAX_MESSAGE_LEN)
|
||||
s = sanitize(copytext(s, 1, MAX_MESSAGE_LEN))
|
||||
if (!s)
|
||||
return
|
||||
if (!in_range(src, usr) && src.loc != usr)
|
||||
|
||||
@@ -848,7 +848,7 @@ Status: []<BR>"},
|
||||
|
||||
if (istype(W, /obj/item/weapon/pen)) // you can rename turrets like bots!
|
||||
var/t = input(user, "Enter new turret name", src.name, src.finish_name) as text
|
||||
t = copytext(sanitize(t), 1, MAX_MESSAGE_LEN)
|
||||
t = sanitize(copytext(t, 1, MAX_MESSAGE_LEN))
|
||||
if (!t)
|
||||
return
|
||||
if (!in_range(src, usr) && src.loc != usr)
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
return
|
||||
if (!in_range(src, user) && src.loc != user)
|
||||
return
|
||||
t = copytext(sanitize(t),1,MAX_MESSAGE_LEN)
|
||||
t = sanitize(copytext(t,1,MAX_MESSAGE_LEN))
|
||||
if (t)
|
||||
src.name = "body bag - "
|
||||
src.name += t
|
||||
|
||||
@@ -689,7 +689,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
||||
U << "The PDA softly beeps."
|
||||
ui.close()
|
||||
else
|
||||
t = copytext(sanitize(t), 1, 20)
|
||||
t = sanitize(copytext(t, 1, 20))
|
||||
ttone = t
|
||||
else
|
||||
ui.close()
|
||||
@@ -897,7 +897,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
||||
/obj/item/device/pda/proc/create_message(var/mob/living/U = usr, var/obj/item/device/pda/P)
|
||||
|
||||
var/t = input(U, "Please enter message", name, null) as text
|
||||
t = copytext(sanitize(t), 1, MAX_MESSAGE_LEN)
|
||||
t = sanitize(copytext(t, 1, MAX_MESSAGE_LEN))
|
||||
t = readd_quotes(t)
|
||||
if (!t || !istype(P))
|
||||
return
|
||||
|
||||
@@ -66,10 +66,11 @@
|
||||
if(user && convert)
|
||||
terrible_conversion_proc(M, user)
|
||||
M.Stun(1)
|
||||
user.visible_message("<span class='disarm'>[user] blinds [M] with the flash!</span>")
|
||||
user.visible_message("<span class='disarm'>[user] blinds [M] with the flash!</span>")
|
||||
return 1
|
||||
else
|
||||
user.visible_message("<span class='disarm'>[user] fails to blind [M] with the flash!</span>")
|
||||
if(user)
|
||||
user.visible_message("<span class='disarm'>[user] fails to blind [M] with the flash!</span>")
|
||||
return 0
|
||||
|
||||
/obj/item/device/flash/attack(mob/living/M, mob/user)
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
user << "\red \The [src] needs to recharge!"
|
||||
return
|
||||
|
||||
var/message = copytext(sanitize(input(user, "Shout a message?", "Megaphone", null) as text),1,MAX_MESSAGE_LEN)
|
||||
var/message = sanitize(copytext(input(user, "Shout a message?", "Megaphone", null) as text,1,MAX_MESSAGE_LEN))
|
||||
if(!message)
|
||||
return
|
||||
message = capitalize(message)
|
||||
|
||||
@@ -265,7 +265,7 @@
|
||||
if(2)
|
||||
radio.ToggleReception()
|
||||
if(href_list["setlaws"])
|
||||
var/newlaws = copytext(sanitize(input("Enter any additional directives you would like your pAI personality to follow. Note that these directives will not override the personality's allegiance to its imprinted master. Conflicting directives will be ignored.", "pAI Directive Configuration", pai.pai_laws) as message),1,MAX_MESSAGE_LEN)
|
||||
var/newlaws = sanitize(copytext(input("Enter any additional directives you would like your pAI personality to follow. Note that these directives will not override the personality's allegiance to its imprinted master. Conflicting directives will be ignored.", "pAI Directive Configuration", pai.pai_laws) as message,1,MAX_MESSAGE_LEN))
|
||||
if(newlaws)
|
||||
pai.pai_laws = newlaws
|
||||
pai << "Your supplemental directives have been updated. Your new directives are:"
|
||||
|
||||
@@ -250,7 +250,7 @@
|
||||
return
|
||||
src.registered_name = t
|
||||
|
||||
var u = copytext(sanitize(input(user, "What occupation would you like to put on this card?\nNote: This will not grant any access levels other than Maintenance.", "Agent card job assignment", "Civilian")),1,MAX_MESSAGE_LEN)
|
||||
var u = sanitize(copytext(input(user, "What occupation would you like to put on this card?\nNote: This will not grant any access levels other than Maintenance.", "Agent card job assignment", "Civilian"),1,MAX_MESSAGE_LEN))
|
||||
if(!u)
|
||||
alert("Invalid assignment.")
|
||||
src.registered_name = ""
|
||||
@@ -265,13 +265,13 @@
|
||||
|
||||
switch(alert("Would you like to display the ID, or retitle it?","Choose.","Rename","Show"))
|
||||
if("Rename")
|
||||
var t = copytext(sanitize(input(user, "What name would you like to put on this card?", "Agent card name", ishuman(user) ? user.real_name : user.name)),1,26)
|
||||
var t = sanitize(copytext(input(user, "What name would you like to put on this card?", "Agent card name", ishuman(user) ? user.real_name : user.name),1,26))
|
||||
if(!t || t == "Unknown" || t == "floor" || t == "wall" || t == "r-wall") //Same as mob/new_player/prefrences.dm
|
||||
alert("Invalid name.")
|
||||
return
|
||||
src.registered_name = t
|
||||
|
||||
var u = copytext(sanitize(input(user, "What occupation would you like to put on this card?\nNote: This will not grant any access levels other than Maintenance.", "Agent card job assignment", "Civilian")),1,MAX_MESSAGE_LEN)
|
||||
var u = sanitize(copytext(input(user, "What occupation would you like to put on this card?\nNote: This will not grant any access levels other than Maintenance.", "Agent card job assignment", "Civilian"),1,MAX_MESSAGE_LEN))
|
||||
if(!u)
|
||||
alert("Invalid assignment.")
|
||||
src.registered_name = ""
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
return
|
||||
if((!in_range(src, usr) && src.loc != user))
|
||||
return
|
||||
t = copytext(sanitize(t),1,MAX_MESSAGE_LEN)
|
||||
t = sanitize(copytext(t,1,MAX_MESSAGE_LEN))
|
||||
if(t)
|
||||
src.name = text("Glass Case- '[]'", t)
|
||||
else
|
||||
|
||||
@@ -111,7 +111,7 @@
|
||||
return
|
||||
if ((!in_range(src, usr) && src.loc != user))
|
||||
return
|
||||
t = copytext(sanitize(t),1,MAX_MESSAGE_LEN)
|
||||
t = sanitize(copytext(t,1,MAX_MESSAGE_LEN))
|
||||
if (t)
|
||||
src.name = text("Morgue- '[]'", t)
|
||||
src.overlays += image(src.icon, "morgue_label")
|
||||
@@ -285,7 +285,7 @@
|
||||
return
|
||||
if ((!in_range(src, usr) > 1 && src.loc != user))
|
||||
return
|
||||
t = copytext(sanitize(t),1,MAX_MESSAGE_LEN)
|
||||
t = sanitize(copytext(t,1,MAX_MESSAGE_LEN))
|
||||
if (t)
|
||||
src.name = text("Crematorium- '[]'", t)
|
||||
else
|
||||
|
||||
@@ -373,7 +373,7 @@ var/list/mechtoys = list(
|
||||
if(!istype(P)) return
|
||||
|
||||
var/timeout = world.time + 600
|
||||
var/reason = copytext(sanitize(input(usr,"Reason:","Why do you require this item?","") as null|text),1,MAX_MESSAGE_LEN)
|
||||
var/reason = sanitize(copytext(input(usr,"Reason:","Why do you require this item?","") as null|text,1,MAX_MESSAGE_LEN))
|
||||
if(world.time > timeout) return
|
||||
if(!reason) return
|
||||
|
||||
@@ -578,7 +578,7 @@ var/list/mechtoys = list(
|
||||
if(!istype(P)) return
|
||||
|
||||
var/timeout = world.time + 600
|
||||
var/reason = copytext(sanitize(input(usr,"Reason:","Why do you require this item?","") as null|text),1,MAX_MESSAGE_LEN)
|
||||
var/reason = sanitize(copytext(input(usr,"Reason:","Why do you require this item?","") as null|text,1,MAX_MESSAGE_LEN))
|
||||
if(world.time > timeout) return
|
||||
if(!reason) return
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ var/global/normal_ooc_colour = "#002eb8"
|
||||
src << "Guests may not use OOC."
|
||||
return
|
||||
|
||||
msg = trim(copytext(sanitize(msg), 1, MAX_MESSAGE_LEN))
|
||||
msg = trim(sanitize(copytext(msg, 1, MAX_MESSAGE_LEN)))
|
||||
if(!msg) return
|
||||
|
||||
if(!(prefs.toggles & CHAT_OOC))
|
||||
@@ -92,7 +92,7 @@ var/global/normal_ooc_colour = "#002eb8"
|
||||
src << "Guests may not use OOC."
|
||||
return
|
||||
|
||||
msg = trim(copytext(sanitize(msg), 1, MAX_MESSAGE_LEN))
|
||||
msg = trim(sanitize(copytext(msg, 1, MAX_MESSAGE_LEN)))
|
||||
if(!msg) return
|
||||
|
||||
if(!(prefs.toggles & CHAT_LOOC))
|
||||
|
||||
Reference in New Issue
Block a user